src/main/java/de/uapcore/lightpit/MenuEntry.java

changeset 71
dca186d3911f
parent 70
821c4950b619
child 79
f64255a88d66
equal deleted inserted replaced
70:821c4950b619 71:dca186d3911f
43 * Resource key for the menu label. 43 * Resource key for the menu label.
44 */ 44 */
45 private final ResourceKey resourceKey; 45 private final ResourceKey resourceKey;
46 46
47 /** 47 /**
48 * Custom menu text.
49 */
50 private final String text;
51
52 /**
48 * Path name of the module, linked by this menu entry. 53 * Path name of the module, linked by this menu entry.
49 */ 54 */
50 private final String pathName; 55 private final String pathName;
51 56
52 /** 57 /**
53 * Sequence number to determine the ordering of the menu. 58 * Sequence number to determine the ordering of the menu.
54 */ 59 */
55 private final int sequence; 60 private final int sequence;
56 61
62 /**
63 * True if this menu entry is active.
64 */
65 private boolean active = false;
66
57 public MenuEntry(ResourceKey resourceKey, String pathName, int sequence) { 67 public MenuEntry(ResourceKey resourceKey, String pathName, int sequence) {
68 this.text = null;
58 this.resourceKey = resourceKey; 69 this.resourceKey = resourceKey;
59 this.pathName = pathName; 70 this.pathName = pathName;
60 this.sequence = sequence; 71 this.sequence = sequence;
61 } 72 }
62 73
63 public MenuEntry(ResourceKey resourceKey, String pathName) { 74 public MenuEntry(String text, String pathName, int sequence) {
64 this(resourceKey, pathName, 0); 75 this.text = text;
76 this.resourceKey = null;
77 this.pathName = pathName;
78 this.sequence = sequence;
65 } 79 }
66 80
67 public ResourceKey getResourceKey() { 81 public ResourceKey getResourceKey() {
68 return resourceKey; 82 return resourceKey;
83 }
84
85 public String getText() {
86 return text;
69 } 87 }
70 88
71 public String getPathName() { 89 public String getPathName() {
72 return pathName; 90 return pathName;
73 } 91 }
74 92
75 public int getSequence() { 93 public int getSequence() {
76 return sequence; 94 return sequence;
95 }
96
97 public boolean isActive() {
98 return this.active;
99 }
100
101 public void setActive(boolean active) {
102 this.active = true;
77 } 103 }
78 104
79 @Override 105 @Override
80 public boolean equals(Object o) { 106 public boolean equals(Object o) {
81 if (this == o) return true; 107 if (this == o) return true;

mercurial