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

changeset 71
dca186d3911f
parent 70
821c4950b619
child 79
f64255a88d66
     1.1 --- a/src/main/java/de/uapcore/lightpit/MenuEntry.java	Tue May 19 19:34:57 2020 +0200
     1.2 +++ b/src/main/java/de/uapcore/lightpit/MenuEntry.java	Fri May 22 16:21:31 2020 +0200
     1.3 @@ -45,6 +45,11 @@
     1.4      private final ResourceKey resourceKey;
     1.5  
     1.6      /**
     1.7 +     * Custom menu text.
     1.8 +     */
     1.9 +    private final String text;
    1.10 +
    1.11 +    /**
    1.12       * Path name of the module, linked by this menu entry.
    1.13       */
    1.14      private final String pathName;
    1.15 @@ -54,20 +59,33 @@
    1.16       */
    1.17      private final int sequence;
    1.18  
    1.19 +    /**
    1.20 +     * True if this menu entry is active.
    1.21 +     */
    1.22 +    private boolean active = false;
    1.23 +
    1.24      public MenuEntry(ResourceKey resourceKey, String pathName, int sequence) {
    1.25 +        this.text = null;
    1.26          this.resourceKey = resourceKey;
    1.27          this.pathName = pathName;
    1.28          this.sequence = sequence;
    1.29      }
    1.30  
    1.31 -    public MenuEntry(ResourceKey resourceKey, String pathName) {
    1.32 -        this(resourceKey, pathName, 0);
    1.33 +    public MenuEntry(String text, String pathName, int sequence) {
    1.34 +        this.text = text;
    1.35 +        this.resourceKey = null;
    1.36 +        this.pathName = pathName;
    1.37 +        this.sequence = sequence;
    1.38      }
    1.39  
    1.40      public ResourceKey getResourceKey() {
    1.41          return resourceKey;
    1.42      }
    1.43  
    1.44 +    public String getText() {
    1.45 +        return text;
    1.46 +    }
    1.47 +
    1.48      public String getPathName() {
    1.49          return pathName;
    1.50      }
    1.51 @@ -76,6 +94,14 @@
    1.52          return sequence;
    1.53      }
    1.54  
    1.55 +    public boolean isActive() {
    1.56 +        return this.active;
    1.57 +    }
    1.58 +
    1.59 +    public void setActive(boolean active) {
    1.60 +        this.active = true;
    1.61 +    }
    1.62 +
    1.63      @Override
    1.64      public boolean equals(Object o) {
    1.65          if (this == o) return true;

mercurial