Skip to content

Commit d78ed33

Browse files
committed
MenuEntry: implement Named interface
1 parent 2be0eb4 commit d78ed33

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/main/java/org/scijava/MenuEntry.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* @author Curtis Rueden
4040
* @author Johannes Schindelin
4141
*/
42-
public class MenuEntry {
42+
public class MenuEntry implements Named {
4343

4444
public static final double DEFAULT_WEIGHT = Double.POSITIVE_INFINITY;
4545

@@ -68,14 +68,6 @@ public MenuEntry(final String name, final double weight,
6868
setIconPath(iconPath);
6969
}
7070

71-
public void setName(final String name) {
72-
this.name = name;
73-
}
74-
75-
public String getName() {
76-
return name;
77-
}
78-
7971
public void setWeight(final double weight) {
8072
this.weight = weight;
8173
}
@@ -120,6 +112,20 @@ public void assignProperties(final MenuEntry entry) {
120112
if (iconPath == null) iconPath = entry.getIconPath();
121113
}
122114

115+
// -- Named methods --
116+
117+
@Override
118+
public String getName() {
119+
return name;
120+
}
121+
122+
@Override
123+
public void setName(final String name) {
124+
this.name = name;
125+
}
126+
127+
// -- Object methods --
128+
123129
@Override
124130
public String toString() {
125131
return name;

0 commit comments

Comments
 (0)