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/05/21 21:27:39 UTC

svn commit: r408463 - in /myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago: TobagoConstants.java component/UIGridLayout.java

Author: bommel
Date: Sun May 21 12:27:38 2006
New Revision: 408463

URL: http://svn.apache.org/viewvc?rev=408463&view=rev
Log:
don't store layout rows in attribute map 
TOBAGO-71

Modified:
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
    myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java?rev=408463&r1=408462&r2=408463&view=diff
==============================================================================
--- myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java (original)
+++ myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/TobagoConstants.java Sun May 21 12:27:38 2006
@@ -69,7 +69,6 @@
   public static final String ATTR_MARGIN_LEFT = "marginLeft";
   public static final String ATTR_MARGIN_RIGHT = "marginRight";
   public static final String ATTR_MARGIN_TOP = "marginTop";
-  public static final String ATTR_LAYOUT_ROWS = "layoutRows";
   public static final String ATTR_LAYOUT_ORDER = "layoutOrder";
   public static final String ATTR_LAYOUT_TABLE_STYLE = "layoutTableStyle";
   public static final String ATTR_LAYOUT_WIDTH = "layoutWidth";

Modified: myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/core/src/main/java/org/apache/myfaces/tobago/component/UIGridLayout.java?rev=408463&r1=408462&r2=408463&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 Sun May 21 12:27:38 2006
@@ -20,7 +20,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import static org.apache.myfaces.tobago.TobagoConstants.ATTR_COLUMNS;
-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;
@@ -62,6 +61,8 @@
   private String columns;
   private String rows;
 
+  private List<Row> layoutRows;
+
   public String getMarginTop() {
     if (marginTop != null) {
       return marginTop;
@@ -207,6 +208,7 @@
   }
 
   public Object saveState(FacesContext context) {
+    clearRows();
     Object[] saveState = new Object[10];
     saveState[0] = super.saveState(context);
     saveState[1] = rows;
@@ -261,7 +263,7 @@
   }
 
   private void clearRows() {
-    getAttributes().remove(ATTR_LAYOUT_ROWS);
+    layoutRows = null;
   }
 
   public int getColumnCount() {
@@ -277,11 +279,10 @@
   }
 
   public List<Row> ensureRows() {
-    List<Row> rows = (List<Row>) getAttributes().get(ATTR_LAYOUT_ROWS);
-    if (rows == null) {
-      rows = createRows();
+    if (layoutRows == null) {
+      layoutRows = createRows();
     }
-    return rows;
+    return layoutRows;
   }
 
   private List<Row> createRows() {
@@ -310,7 +311,6 @@
         rows.get(i).fill(c, c + spanX, component.isRendered());
       }
     }
-    getAttributes().put(ATTR_LAYOUT_ROWS, rows);
     return rows;
   }