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/10/15 21:20:38 UTC

svn commit: r464257 - in /myfaces/tobago/trunk: core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java example/tobago-example-assembly/pom.xml

Author: bommel
Date: Sun Oct 15 12:20:36 2006
New Revision: 464257

URL: http://svn.apache.org/viewvc?view=rev&rev=464257
Log:
added Property label to UIColumn
short the name of tobago example assembly

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java
    myfaces/tobago/trunk/example/tobago-example-assembly/pom.xml

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java?view=diff&rev=464257&r1=464256&r2=464257
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java Sun Oct 15 12:20:36 2006
@@ -18,6 +18,7 @@
 
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_ALIGN;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_SORTABLE;
+import static org.apache.myfaces.tobago.TobagoConstants.ATTR_LABEL;
 
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
@@ -33,38 +34,41 @@
   public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Column";
   private Boolean sortable;
   private String align;
+  private String label;
 
 
-   public void restoreState(FacesContext context, Object state) {
-     Object[] values = (Object[]) state;
-     super.restoreState(context, values[0]);
-     align = (String) values[1];
-     sortable = (Boolean) values[2];
-   }
-
-   public Object saveState(FacesContext context) {
-     Object[] values = new Object[3];
-     values[0] = super.saveState(context);
-     values[1] = align;
-     values[2] = sortable;
-     return values;
-   }
-
-   public boolean isSortable() {
-     if (sortable != null) {
-       return sortable;
-     }
-     ValueBinding vb = getValueBinding(ATTR_SORTABLE);
-     if (vb != null) {
-       return (Boolean.TRUE.equals(vb.getValue(getFacesContext())));
-     } else {
-       return false;
-     }
-   }
-
-   public void setSortable(boolean sortable) {
-     this.sortable = sortable;
-   }
+  public void restoreState(FacesContext context, Object state) {
+    Object[] values = (Object[]) state;
+    super.restoreState(context, values[0]);
+    align = (String) values[1];
+    sortable = (Boolean) values[2];
+    label = (String) values[3];
+  }
+
+  public Object saveState(FacesContext context) {
+    Object[] values = new Object[4];
+    values[0] = super.saveState(context);
+    values[1] = align;
+    values[2] = sortable;
+    values[3] = label;
+    return values;
+  }
+
+  public boolean isSortable() {
+    if (sortable != null) {
+      return sortable;
+    }
+    ValueBinding vb = getValueBinding(ATTR_SORTABLE);
+    if (vb != null) {
+      return (Boolean.TRUE.equals(vb.getValue(getFacesContext())));
+    } else {
+      return false;
+    }
+  }
+
+  public void setSortable(boolean sortable) {
+    this.sortable = sortable;
+  }
 
   public String getAlign() {
     if (align != null) {
@@ -80,6 +84,22 @@
 
   public void setAlign(String align) {
     this.align = align;
+  }
+
+  public String getLabel() {
+    if (label != null) {
+      return label;
+    }
+    ValueBinding vb = getValueBinding(ATTR_LABEL);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return label;
+    }
+  }
+
+  public void setLabel(String label) {
+    this.label = label;
   }
 
 }

Modified: myfaces/tobago/trunk/example/tobago-example-assembly/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/tobago-example-assembly/pom.xml?view=diff&rev=464257&r1=464256&r2=464257
==============================================================================
--- myfaces/tobago/trunk/example/tobago-example-assembly/pom.xml (original)
+++ myfaces/tobago/trunk/example/tobago-example-assembly/pom.xml Sun Oct 15 12:20:36 2006
@@ -18,7 +18,7 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>tobago-example-assembly</artifactId>
   <packaging>pom</packaging>
-  <name>Tobago Example Assembly</name>
+  <name>Example Assembly</name>
   <description>This is the MyFaces Tobago Example Assembly</description>
 
   <parent>