myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r488045 - in /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago: component/UIColumn.java taglib/component/ColumnTag.java taglib/component/ColumnTagDeclaration.java
Date Sun, 17 Dec 2006 20:39:53 GMT
Author: bommel
Date: Sun Dec 17 12:39:52 2006
New Revision: 488045

URL: http://svn.apache.org/viewvc?view=rev&rev=488045
Log:
(TOBAGO-216) markup attribute for column component

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIColumn.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java

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=488045&r1=488044&r2=488045
==============================================================================
--- 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 Dec 17 12:39:52 2006
@@ -20,6 +20,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 static org.apache.myfaces.tobago.TobagoConstants.ATTR_MARKUP;
 
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
@@ -31,12 +32,12 @@
  * Date: 18.04.2006
  * Time: 21:50:29
  */
-public class UIColumn extends javax.faces.component.UIColumn {
+public class UIColumn extends javax.faces.component.UIColumn implements SupportsMarkup {
   public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Column";
   private Boolean sortable;
   private String align;
   private String label;
-
+  private String markup;
 
   public void restoreState(FacesContext context, Object state) {
     Object[] values = (Object[]) state;
@@ -44,15 +45,33 @@
     align = (String) values[1];
     sortable = (Boolean) values[2];
     label = (String) values[3];
+    markup = (String) values[4];
   }
 
   public Object saveState(FacesContext context) {
-    Object[] values = new Object[4];
+    Object[] values = new Object[5];
     values[0] = super.saveState(context);
     values[1] = align;
     values[2] = sortable;
     values[3] = label;
+    values[4] = markup;
     return values;
+  }
+
+  public String getMarkup() {
+    if (markup != null) {
+      return markup;
+    }
+    ValueBinding vb = getValueBinding(ATTR_MARKUP);
+    if (vb != null) {
+      return (String) vb.getValue(getFacesContext());
+    } else {
+      return null;
+    }
+  }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
   }
 
   public boolean isSortable() {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java?view=diff&rev=488045&r1=488044&r2=488045
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTag.java
Sun Dec 17 12:39:52 2006
@@ -19,6 +19,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_MARKUP;
 import org.apache.myfaces.tobago.component.ComponentUtil;
 import org.apache.myfaces.tobago.component.UIColumn;
 
@@ -30,6 +31,7 @@
 
   private String sortable;
   private String align;
+  private String markup;
 
   public String getComponentType() {
     return UIColumn.COMPONENT_TYPE;
@@ -43,12 +45,18 @@
     super.release();
     sortable = null;
     align = null;
+    markup = null;
   }
 
   protected void setProperties(UIComponent component) {
     super.setProperties(component);
     ComponentUtil.setBooleanProperty(component, ATTR_SORTABLE, sortable);
     ComponentUtil.setStringProperty(component, ATTR_ALIGN, align);
+    ComponentUtil.setStringProperty(component, ATTR_MARKUP, markup);
+  }
+
+  public void setMarkup(String markup) {
+    this.markup = markup;
   }
 
   public String getAlign() {

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java?view=diff&rev=488045&r1=488044&r2=488045
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
(original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/taglib/component/ColumnTagDeclaration.java
Sun Dec 17 12:39:52 2006
@@ -55,4 +55,12 @@
   @UIComponentTagAttribute(type = { "java.lang.Boolean" },
       defaultValue = "false")
   void setSortable(String sortable);
+
+  /**
+   * Indicate markup of this component.
+   * Possible value is 'none'. But this can be overridden in the theme.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute(defaultValue = "none")
+  void setMarkup(String markup);
 }



Mime
View raw message