You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/04/18 16:05:31 UTC

svn commit: r394947 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml example/facelets/src/main/webapp/helloWorld.xml

Author: bommel
Date: Tue Apr 18 07:04:53 2006
New Revision: 394947

URL: http://svn.apache.org/viewcvs?rev=394947&view=rev
Log:
fixed errors for facelet support

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java
    myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml
    myfaces/tobago/trunk/example/facelets/src/main/webapp/helloWorld.xml

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java?rev=394947&r1=394946&r2=394947&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java Tue Apr 18 07:04:53 2006
@@ -23,10 +23,19 @@
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_ROWS;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SPAN_X;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SPAN_Y;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_BORDER;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_CELLSPACING;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_MARGIN;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_MARGIN_BOTTOM;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_MARGIN_LEFT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_MARGIN_RIGHT;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LAYOUT_MARGIN_TOP;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ROWS;
 import org.apache.myfaces.tobago.util.LayoutUtil;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
 import java.io.IOException;
 import java.io.Serializable;
 import java.util.ArrayList;
@@ -42,6 +51,160 @@
   public static final Marker FREE = new Marker("free");
   public static final String USED = "used";
 
+  private String border;
+  private String cellspacing;
+
+  private String margin;
+  private String marginTop;
+  private String marginRight;
+  private String marginBottom;
+  private String marginLeft;
+  private String columns;
+  private String rows;
+
+  public String getMarginTop() {
+    if (marginTop != null) {
+      return marginTop;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LAYOUT_MARGIN_TOP);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return marginTop;
+    }
+  }
+
+  public String getMarginRight() {
+    if (marginRight != null) {
+      return marginRight;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LAYOUT_MARGIN_RIGHT);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return marginRight;
+    }
+  }
+
+  public String getMarginBottom() {
+    if (marginBottom != null) {
+      return marginBottom;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LAYOUT_MARGIN_BOTTOM);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return marginBottom;
+    }
+  }
+
+  public String getMarginLeft() {
+    if (marginLeft != null) {
+      return marginLeft;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LAYOUT_MARGIN_LEFT);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return marginLeft;
+    }
+  }
+
+  public String getMargin() {
+    if (margin != null) {
+      return margin;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LAYOUT_MARGIN);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return margin;
+    }
+  }
+
+  public String getRows() {
+    if (rows != null) {
+      return rows;
+    }
+    ValueBinding vb = getValueBinding(ATTR_ROWS);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return rows;
+    }
+  }
+
+  public String getColumns() {
+    if (columns != null) {
+      return columns;
+    }
+    ValueBinding vb = getValueBinding(ATTR_COLUMNS);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return columns;
+    }
+  }
+
+  public String getCellspacing() {
+    if (cellspacing != null) {
+      return cellspacing;
+    }
+    ValueBinding vb = getValueBinding(ATTR_CELLSPACING);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return cellspacing;
+    }
+  }
+
+  public String getBorder() {
+    if (border != null) {
+      return border;
+    }
+    ValueBinding vb = getValueBinding(ATTR_BORDER);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return border;
+    }
+  }
+
+  public void setBorder(String border) {
+    this.border = border;
+  }
+
+  public void setCellspacing(String cellspacing) {
+    this.cellspacing = cellspacing;
+  }
+
+  public void setMargin(String margin) {
+    this.margin = margin;
+  }
+
+  public void setMarginTop(String marginTop) {
+    this.marginTop = marginTop;
+  }
+
+  public void setMarginRight(String marginRight) {
+    this.marginRight = marginRight;
+  }
+
+  public void setMarginBottom(String marginBottom) {
+    this.marginBottom = marginBottom;
+  }
+
+  public void setMarginLeft(String marginLeft) {
+    this.marginLeft = marginLeft;
+  }
+
+  public void setColumns(String columns) {
+    this.columns = columns;
+  }
+
+  public void setRows(String rows) {
+    this.rows = rows;
+  }
 
 
   @Override

Modified: myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml?rev=394947&r1=394946&r2=394947&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml (original)
+++ myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/facelets/tags/tobago-extension.taglib.xml Tue Apr 18 07:04:53 2006
@@ -32,8 +32,4 @@
 		<tag-name>selectManyListbox</tag-name>
 		<source>selectManyListbox.xhtml</source>
 	</tag>
-  <tag>
-     <tag-name>attribute</tag-name>
-     <handler-class>org.apache.myfaces.tobago.example.facelets.AttributeHandler</handler-class>
-   </tag>
 </facelet-taglib>

Modified: myfaces/tobago/trunk/example/facelets/src/main/webapp/helloWorld.xml
URL: http://svn.apache.org/viewcvs/myfaces/tobago/trunk/example/facelets/src/main/webapp/helloWorld.xml?rev=394947&r1=394946&r2=394947&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/webapp/helloWorld.xml (original)
+++ myfaces/tobago/trunk/example/facelets/src/main/webapp/helloWorld.xml Tue Apr 18 07:04:53 2006
@@ -7,7 +7,7 @@
     </f:facet>
     <tc:out value="Hello World!"/>
     <tx:in label="foo" value="#{counter.count}" >
-       <tx:attribute name="validator" value="#{counter.customValidator}" />
+       <tc:attribute name="validator" value="#{counter.customValidator}" />
     </tx:in>
     <tc:button label="Count++" defaultCommand="true" />
   </tc:page>