[jboss-cvs] jboss-seam/src/main/org/jboss/seam/pages ...

Gavin King gavin.king at jboss.com
Mon Dec 18 10:38:49 EST 2006


  User: gavin   
  Date: 06/12/18 10:38:49

  Modified:    src/main/org/jboss/seam/pages   ActionNavigation.java
                        Outcome.java
  Log:
  new validation component,
  reworked navigation rules
  
  Revision  Changes    Path
  1.2       +12 -19    jboss-seam/src/main/org/jboss/seam/pages/ActionNavigation.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ActionNavigation.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/ActionNavigation.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- ActionNavigation.java	17 Dec 2006 19:46:41 -0000	1.1
  +++ ActionNavigation.java	18 Dec 2006 15:38:49 -0000	1.2
  @@ -3,47 +3,40 @@
    */
   package org.jboss.seam.pages;
   
  -import java.util.HashMap;
  -import java.util.Map;
  +import java.util.ArrayList;
  +import java.util.List;
   
   import org.jboss.seam.core.Expressions.ValueBinding;
   
   public final class ActionNavigation
   {
      private ValueBinding<Object> outcomeValueBinding;
  -   private Map<String, Outcome> outcomes = new HashMap<String, Outcome>();
  -   private Outcome nullOutcome;
  -   private Outcome anyOutcome;
  +   private List<Outcome> outcomes = new ArrayList<Outcome>();
  +   private Outcome outcome;
      
  -   public Map<String, Outcome> getOutcomes()
  +   public List<Outcome> getOutcomes()
      {
         return outcomes;
      }
      
  -   public void setNullOutcome(Outcome outcome)
  -   {
  -      this.nullOutcome = outcome;
  -   }
  -   public Outcome getNullOutcome()
  -   {
  -      return nullOutcome;
  -   }
  -   
      public void setOutcomeValueBinding(ValueBinding<Object> outcomeValueBinding)
      {
         this.outcomeValueBinding = outcomeValueBinding;
      }
  +   
      public ValueBinding<Object> getOutcomeValueBinding()
      {
         return outcomeValueBinding;
      }
   
  -   public Outcome getAnyOutcome()
  +   public Outcome getOutcome()
      {
  -      return anyOutcome;
  +      return outcome;
      }
  -   public void setAnyOutcome(Outcome outcome)
  +
  +   public void setOutcome(Outcome outcome)
      {
  -      this.anyOutcome = outcome;
  +      this.outcome = outcome;
      }
  +
   }
  \ No newline at end of file
  
  
  
  1.2       +37 -1     jboss-seam/src/main/org/jboss/seam/pages/Outcome.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Outcome.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/Outcome.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- Outcome.java	17 Dec 2006 19:46:41 -0000	1.1
  +++ Outcome.java	18 Dec 2006 15:38:49 -0000	1.2
  @@ -3,10 +3,26 @@
    */
   package org.jboss.seam.pages;
   
  +import javax.faces.context.FacesContext;
  +
  +import org.jboss.seam.core.Expressions.ValueBinding;
  +
   public final class Outcome
   {
  -   private NavigationHandler navigationHandler;
  +   private String value;
  +   private ValueBinding expression;
      private ConversationControl conversationControl = new ConversationControl();
  +   private NavigationHandler navigationHandler = new NavigationHandler() { 
  +      @Override
  +      public void navigate(FacesContext context) {}
  +   };
  +
  +   public boolean matches(String actualValue)
  +   {
  +      return ( actualValue!=null || expression!=null ) &&
  +            ( value==null || value.equals(actualValue) ) &&
  +            ( expression==null || Boolean.TRUE.equals( expression.getValue() ) );
  +   }
   
      public NavigationHandler getNavigationHandler()
      {
  @@ -22,4 +38,24 @@
      {
         return conversationControl;
      }
  +
  +   public ValueBinding getExpression()
  +   {
  +      return expression;
  +   }
  +
  +   public void setExpression(ValueBinding expression)
  +   {
  +      this.expression = expression;
  +   }
  +
  +   public String getValue()
  +   {
  +      return value;
  +   }
  +
  +   public void setValue(String value)
  +   {
  +      this.value = value;
  +   }
   }
  \ No newline at end of file
  
  
  



More information about the jboss-cvs-commits mailing list