[jboss-cvs] jboss-portal/portlet/src/main/org/jboss/portal/portlet ...

Chris Laprun chris.laprun at jboss.com
Wed Jul 19 13:17:41 EDT 2006


  User: claprun 
  Date: 06/07/19 13:17:41

  Modified:    portlet/src/main/org/jboss/portal/portlet     Mode.java
                        WindowState.java
  Removed:     portlet/src/main/org/jboss/portal/portlet    
                        Actionable.java BaseActionable.java
  Log:
  JBPORTAL-958:
  - Separated concerns: states and modes do not contain ordering logic anymore.
  - Ordering is done in DivDecorationRenderer.
  - Removed Actionable and BaseActionable.
  - Moved constants for action map to WindowResult.
  
  Revision  Changes    Path
  1.3       +36 -8     jboss-portal/portlet/src/main/org/jboss/portal/portlet/Mode.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Mode.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/Mode.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Mode.java	18 Jul 2006 22:29:27 -0000	1.2
  +++ Mode.java	19 Jul 2006 17:17:41 -0000	1.3
  @@ -25,9 +25,9 @@
   
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class Mode extends BaseActionable implements Serializable
  +public class Mode implements Serializable
   {
   
      /**
  @@ -38,26 +38,54 @@
      /**
       * .
       */
  -   public static final Mode EDIT = new Mode("edit", 101);
  +   public static final Mode EDIT = new Mode("edit");
   
      /**
       * .
       */
  -   public static final Mode HELP = new Mode("help", 102);
  +   public static final Mode HELP = new Mode("help");
   
      /**
       * .
       */
  -   public static final Mode VIEW = new Mode("view", 103);
  +   public static final Mode VIEW = new Mode("view");
   
      /**
       * .
       */
  -   public static final Mode EDIT_DEFAULTS = new Mode("edit_defaults", 100);
  +   public static final Mode EDIT_DEFAULTS = new Mode("edit_defaults");
   
  -   protected Mode(String name, int index)
  +   /**
  +    * .
  +    */
  +   private String name;
  +
  +   public Mode(String name)
  +   {
  +      if (name == null)
  +      {
  +         throw new NullPointerException();
  +      }
  +      this.name = name;
  +   }
  +
  +   public boolean equals(Object o)
  +   {
  +      if (o instanceof Mode)
  +      {
  +         return o == this || name.equalsIgnoreCase(((Mode)o).name);
  +      }
  +      return false;
  +   }
  +
  +   public int hashCode()
  +   {
  +      return name.hashCode();
  +   }
  +
  +   public String toString()
      {
  -      super(name, index);
  +      return name;
      }
   
      private Object readResolve()
  @@ -104,7 +132,7 @@
         }
         else
         {
  -         return new Mode(s, lastUsedIndex++);
  +         return new Mode(s);
         }
      }
   }
  
  
  
  1.3       +31 -7     jboss-portal/portlet/src/main/org/jboss/portal/portlet/WindowState.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WindowState.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/WindowState.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- WindowState.java	18 Jul 2006 22:29:27 -0000	1.2
  +++ WindowState.java	19 Jul 2006 17:17:41 -0000	1.3
  @@ -25,23 +25,47 @@
   
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public class WindowState extends BaseActionable implements Serializable
  +public class WindowState implements Serializable
   {
   
      /**
       * The serialVersionUID
       */
      private static final long serialVersionUID = -6305311518934458562L;
  +   public static final WindowState NORMAL = new WindowState("normal");
  +   public static final WindowState MINIMIZED = new WindowState("minimized");
  +   public static final WindowState MAXIMIZED = new WindowState("maximized");
   
  -   public static final WindowState NORMAL = new WindowState("normal", 101);
  -   public static final WindowState MINIMIZED = new WindowState("minimized", 100);
  -   public static final WindowState MAXIMIZED = new WindowState("maximized", 102);
  +   private String name;
   
  -   protected WindowState(String name, int index)
  +   public WindowState(String name)
      {
  -      super(name, index);
  +      if (name == null)
  +      {
  +         throw new IllegalArgumentException("Window state name cannot be null.");
  +      }
  +      this.name = name;
  +   }
  +
  +   public boolean equals(Object o)
  +   {
  +      if (o instanceof WindowState)
  +      {
  +         return o == this || name.equalsIgnoreCase(((WindowState)o).name);
  +      }
  +      return false;
  +   }
  +
  +   public int hashCode()
  +   {
  +      return name.hashCode();
  +   }
  +
  +   public String toString()
  +   {
  +      return name;
      }
   
      private Object readResolve()
  @@ -80,7 +104,7 @@
         }
         else
         {
  -         return new WindowState(s, lastUsedIndex++);
  +         return new WindowState(s);
         }
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list