You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2008/08/05 19:44:01 UTC

svn commit: r682828 - in /myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component: UIXTreeTableTemplate.java UIXTreeTemplate.java

Author: matzew
Date: Tue Aug  5 10:44:01 2008
New Revision: 682828

URL: http://svn.apache.org/viewvc?rev=682828&view=rev
Log:
TRINIDAD-1172 - Support for stamping of tree/treeTable

Thx to Kamran Kashanian for his patch

Modified:
    myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
    myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java?rev=682828&r1=682827&r2=682828&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTableTemplate.java Tue Aug  5 10:44:01 2008
@@ -430,6 +430,33 @@
     }
   }
 
+  /**
+   * Gets the internal state of this component.
+   */
+  @Override
+  Object __getMyStampState()
+  {
+    Object[] state = new Object[2];
+    state[0] = super.__getMyStampState();
+    state[1] = (_firstMap.isEmpty()) ? null : _firstMap;
+
+    return state;
+  }
+  
+  /**
+   * Sets the internal state of this component.
+   * @param stampState the internal state is obtained from this object.
+   */
+  @Override
+  @SuppressWarnings("unchecked")
+  void __setMyStampState(Object stampState)
+  {
+    Object[] state = (Object[]) stampState;
+    super.__setMyStampState(state[0]);
+    _firstMap = (Map<Object, Integer>) state[1];
+    if (_firstMap == null)
+      _firstMap = Collections.emptyMap();
+  }
 
   private Map<Object, Integer> _firstMap = Collections.emptyMap();
   // cache of child components inside this treeTable header/footer facets and column header/footer

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java?rev=682828&r1=682827&r2=682828&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java (original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/UIXTreeTemplate.java Tue Aug  5 10:44:01 2008
@@ -153,6 +153,37 @@
       setSelectedRowKeys(new RowKeySetTreeImpl());
   }
   
+  
+  /**
+   * Gets the internal state of this component.
+   */
+  @Override
+  Object __getMyStampState()
+  {
+    Object[] state = new Object[4];
+    state[0] = super.__getMyStampState();
+    state[1] = getFocusRowKey();    
+    state[2] = getSelectedRowKeys();
+    state[3] = getDisclosedRowKeys();
+    return state;
+  }
+  
+  /**
+   * Sets the internal state of this component.
+   * @param stampState the internal state is obtained from this object.
+   */
+  @Override
+  @SuppressWarnings("unchecked")
+  void __setMyStampState(Object stampState)
+  {
+    Object[] state = (Object[]) stampState;
+    super.__setMyStampState(state[0]);
+    setFocusRowKey(state[1]);
+    setSelectedRowKeys((RowKeySet) state[2]);
+    setDisclosedRowKeys((RowKeySet) state[3]);
+  }
+  
+  
   private final static String EXPAND_ONCE_KEY = "initialExpandCompleted";
 
   /**