[jboss-cvs] jboss-seam/src/ui/org/jboss/seam/ui ...

Gavin King gavin.king at jboss.com
Sun Oct 1 21:10:57 EDT 2006


  User: gavin   
  Date: 06/10/01 21:10:57

  Modified:    src/ui/org/jboss/seam/ui   UIDecorate.java
                        UIDecorations.java
  Log:
  allow the facet on s:decorate as well as s:decorations
  
  Revision  Changes    Path
  1.2       +22 -12    jboss-seam/src/ui/org/jboss/seam/ui/UIDecorate.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIDecorate.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/UIDecorate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UIDecorate.java	2 Oct 2006 01:01:37 -0000	1.1
  +++ UIDecorate.java	2 Oct 2006 01:10:57 -0000	1.2
  @@ -93,14 +93,23 @@
         this.forId = forId;
      }
   
  +   private UIComponent getDecoration(String name)
  +   {
  +      UIComponent dec = getFacet(name);
  +      if (dec==null)
  +      {
  +         dec = getParentDecorations(this).getFacet(name);
  +      }
  +      return dec;
  +   }
  +
      @Override
      public void encodeBegin(FacesContext context) throws IOException
      {
         super.encodeBegin(context);
         boolean hasMessage = hasMessage();
  -      UIDecorations parentDecorations = getParentDecorations(this);
  -      UIComponent aroundDecoration = parentDecorations.getAroundDecoration();
  -      UIComponent aroundInvalidDecoration = parentDecorations.getAroundInvalidDecoration();
  +      UIComponent aroundDecoration = getDecoration("aroundField");
  +      UIComponent aroundInvalidDecoration = getDecoration("aroundInvalidField");
         if (aroundDecoration!=null && !hasMessage)
         {
            aroundDecoration.setParent(this);
  @@ -117,9 +126,8 @@
      public void encodeEnd(FacesContext context) throws IOException
      {
         boolean hasMessage = hasMessage();
  -      UIDecorations parentDecorations = getParentDecorations(this);
  -      UIComponent aroundDecoration = parentDecorations.getAroundDecoration();
  -      UIComponent aroundInvalidDecoration = parentDecorations.getAroundInvalidDecoration();
  +      UIComponent aroundDecoration = getDecoration("aroundField");
  +      UIComponent aroundInvalidDecoration = getDecoration("aroundInvalidField");
         if (aroundDecoration!=null && !hasMessage)
         {
            aroundDecoration.setParent(this);
  @@ -137,11 +145,9 @@
      public void encodeChildren(FacesContext facesContext) throws IOException
      {
         boolean hasMessage = hasMessage();
  -      UIDecorations parentDecorations = getParentDecorations(this);
  -      UIComponent beforeDecoration = parentDecorations.getBeforeDecoration();
  -      UIComponent afterDecoration = parentDecorations.getAfterDecoration();
  -      UIComponent beforeInvalidDecoration = parentDecorations.getBeforeInvalidDecoration();
  -      UIComponent afterInvalidDecoration = parentDecorations.getAfterInvalidDecoration();
  +
  +      UIComponent beforeDecoration = getDecoration("beforeField");
  +      UIComponent beforeInvalidDecoration = getDecoration("beforeInvalidField");
         if ( beforeDecoration!=null && !hasMessage )
         {
            beforeDecoration.setParent(this);
  @@ -152,7 +158,11 @@
            beforeInvalidDecoration.setParent(this);
            JSF.renderChild(facesContext, beforeInvalidDecoration);
         }
  +      
         JSF.renderChildren(facesContext, this);
  +      
  +      UIComponent afterDecoration = getDecoration("afterField");
  +      UIComponent afterInvalidDecoration = getDecoration("afterInvalidField");
         if ( afterDecoration!=null  && !hasMessage )
         {
            afterDecoration.setParent(this);
  
  
  
  1.2       +0 -31     jboss-seam/src/ui/org/jboss/seam/ui/UIDecorations.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIDecorations.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/ui/org/jboss/seam/ui/UIDecorations.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UIDecorations.java	2 Oct 2006 01:01:37 -0000	1.1
  +++ UIDecorations.java	2 Oct 2006 01:10:57 -0000	1.2
  @@ -1,6 +1,5 @@
   package org.jboss.seam.ui;
   
  -import javax.faces.component.UIComponent;
   import javax.faces.component.UIComponentBase;
   
   public class UIDecorations extends UIComponentBase
  @@ -15,34 +14,4 @@
         return COMPONENT_FAMILY;
      }
      
  -   public UIComponent getBeforeInvalidDecoration()
  -   {
  -      return getFacet("beforeInvalidField");
  -   }
  -
  -   public UIComponent getAfterInvalidDecoration()
  -   {
  -      return getFacet("afterInvalidField");
  -   }
  -
  -   public UIComponent getAroundInvalidDecoration()
  -   {
  -      return getFacet("aroundInvalidField");
  -   }
  -
  -   public UIComponent getBeforeDecoration()
  -   {
  -      return getFacet("beforeField");
  -   }
  -
  -   public UIComponent getAfterDecoration()
  -   {
  -      return getFacet("afterField");
  -   }
  -
  -   public UIComponent getAroundDecoration()
  -   {
  -      return getFacet("aroundField");
  -   }
  -
   }
  
  
  



More information about the jboss-cvs-commits mailing list