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

Gavin King gavin.king at jboss.com
Sun Feb 25 17:38:21 EST 2007


  User: gavin   
  Date: 07/02/25 17:38:21

  Modified:    src/main/org/jboss/seam/pages  Rule.java
  Log:
  nicer impl
  
  Revision  Changes    Path
  1.3       +14 -13    jboss-seam/src/main/org/jboss/seam/pages/Rule.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Rule.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/pages/Rule.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Rule.java	21 Feb 2007 18:33:08 -0000	1.2
  +++ Rule.java	25 Feb 2007 22:38:21 -0000	1.3
  @@ -18,13 +18,7 @@
      private ConversationControl conversationControl = new ConversationControl();
      private TaskControl taskControl = new TaskControl();
      private ProcessControl processControl = new ProcessControl();
  -   private NavigationHandler navigationHandler = new NavigationHandler() { 
  -      @Override
  -      public boolean navigate(FacesContext context) 
  -      {
  -         return false;
  -      }
  -   };
  +   private List<NavigationHandler> navigationHandlers = new ArrayList<NavigationHandler>();
   
      public boolean matches(String actualValue)
      {
  @@ -33,14 +27,14 @@
               ( condition==null || Boolean.TRUE.equals( condition.getValue() ) );
      }
      
  -   public NavigationHandler getNavigationHandler()
  +   public List<NavigationHandler> getNavigationHandlers()
      {
  -      return navigationHandler;
  +      return navigationHandlers;
      }
   
  -   public void setNavigationHandler(NavigationHandler result)
  +   public void addNavigationHandler(NavigationHandler navigationHandler)
      {
  -      this.navigationHandler = result;
  +      this.navigationHandlers.add(navigationHandler);
      }
   
      public ConversationControl getConversationControl()
  @@ -88,7 +82,14 @@
         getConversationControl().beginOrEndConversation();
         getTaskControl().beginOrEndTask();
         getProcessControl().createOrResumeProcess();
  -      for ( Output output: getOutputs() ) output.out();
  -      return getNavigationHandler().navigate(context);
  +      for ( Output output: getOutputs() ) 
  +      {
  +         output.out();
  +      }
  +      for ( NavigationHandler nh: getNavigationHandlers() )
  +      {
  +         if ( nh.navigate(context) ) return true;
  +      }
  +      return false;
      }
   }
  \ No newline at end of file
  
  
  



More information about the jboss-cvs-commits mailing list