Salome HOME
Modifications to respect PMD rules.
[tools/siman.git] / Workspace / Siman / src / org / splat / wapp / MenuItem.java
index fafbac53d40053666d4c8013ea1d0286f1c3c356..a9625cc3156c12b656c0db46e6c708aa31328556 100644 (file)
@@ -1,75 +1,87 @@
 package org.splat.wapp;
 
-
 public class MenuItem extends Item {
 
-    private static final long serialVersionUID = 1002251657309138413L;
+       private static final long serialVersionUID = 1002251657309138413L;
 
        protected static class Group extends MenuItem {
-//  ---------------------------------------------
-      private boolean open = false;
-       /**
-        * Serial version ID.
-        */
-      private static final long serialVersionUID = 8319750643667219000L;
-
-      protected Group (String label)                            { super(label); }
-      protected Group (String label, String icon, String url)   { super(label, icon, url); }
-
-      public boolean isOpen ()                                  { return open; }
-      public void    open ()                                    { open = true; }
-    }
-    protected static class SubItem extends MenuItem {
-//  -----------------------------------------------
-       /**
-        * Serial version ID.
-        */
-      private static final long serialVersionUID = -4793172296421132566L;
-
-      protected SubItem (String label)                          { super(label); }
-      protected SubItem (String label, String icon, String url) { super(label, icon, url); }
-    }
-
-//  ==============================================================================================================================
-//  Construction
-//  ==============================================================================================================================
-
-    public MenuItem (String label) {
-//  ------------------------------
-      super(label);
-    }
-    public MenuItem (String label, String icon, String url) {
-//  -------------------------------------------------------
-      super(label, url);
-      this.icon(icon);
-    }
-    public MenuItem action (String url) {
-//  -----------------------------------
-      super.action(url);
-      return this;
-    }
-    public MenuItem icon (String icon) {
-//  ----------------------------------
-      super.icon(icon);
-      return this;
-    }
-
-//  ==============================================================================================================================
-//  Member functions
-//  ==============================================================================================================================
-
-    public boolean isGroup () {
-//  -------------------------
-      return (this instanceof Group);
-    }
-
-    public boolean isOpen () {
-//  ------------------------
-      return false;                // Redefined in the Group subclass
-    }
-
-    public boolean isSubItem () {
-//  ---------------------------
-      return (this instanceof SubItem);
-    }
+               private transient boolean _open = false;
+               /**
+                * Serial version ID.
+                */
+               private static final long serialVersionUID = 8319750643667219000L;
+
+               protected Group(final String label) {
+                       super(label);
+               }
+
+               protected Group(final String label, final String icon, final String url) {
+                       super(label, icon, url);
+               }
+
+               @Override
+               public boolean isOpen() {
+                       return _open;
+               }
+
+               public void open() {
+                       _open = true;
+               }
+       }
+
+       protected static class SubItem extends MenuItem {
+               /**
+                * Serial version ID.
+                */
+               private static final long serialVersionUID = -4793172296421132566L;
+
+               protected SubItem(final String label) {
+                       super(label);
+               }
+
+               protected SubItem(final String label, final String icon, final String url) {
+                       super(label, icon, url);
+               }
+       }
+
+       // ==============================================================================================================================
+       // Construction
+       // ==============================================================================================================================
+
+       public MenuItem(final String label) {
+               super(label);
+       }
+
+       public MenuItem(final String label, final String icon, final String url) {
+               super(label, url);
+               this.icon(icon);
+       }
+
+       @Override
+       public MenuItem action(final String url) {
+               super.action(url);
+               return this;
+       }
+
+       @Override
+       final public MenuItem icon(final String icon) {
+               super.icon(icon);
+               return this;
+       }
+
+       // ==============================================================================================================================
+       // Member functions
+       // ==============================================================================================================================
+
+       public boolean isGroup() {
+               return (this instanceof Group);
+       }
+
+       public boolean isOpen() {
+               return false; // Redefined in the Group subclass
+       }
+
+       public boolean isSubItem() {
+               return (this instanceof SubItem);
+       }
 }
\ No newline at end of file