Author: abelevich
Date: 2007-05-07 14:34:04 -0400 (Mon, 07 May 2007)
New Revision: 676
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
Log:
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-07
15:33:02 UTC (rev 675)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-07
18:34:04 UTC (rev 676)
@@ -3,13 +3,49 @@
*/
package org.richfaces.component;
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+
import org.ajax4jsf.ajax.repeat.UIRepeat;
+import org.apache.commons.collections.iterators.IteratorChain;
/**
* @author Anton Belevich
*
*/
+
public class UIScrollableGrid extends UIRepeat{
-
+
+
+ protected Iterator dataChildren() {
+
+ IteratorChain chain = new IteratorChain();
+ chain.addIterator(getFacets().values().iterator());
+ for (Iterator i = getChildren().iterator(); i.hasNext(); ) {
+ UIComponent kid = (UIComponent)i.next();
+ if (kid instanceof UIScrollableGridColumn) {
+ UIScrollableGridColumn column = (UIScrollableGridColumn) kid;
+ chain.addIterator(column.getChildIterator());
+ }
+ }
+
+ return chain;
+ }
+
+ protected Iterator fixedChildren() {
+
+ IteratorChain chain = new IteratorChain(getFacets().values().iterator());
+ for (Iterator i = getChildren().iterator(); i.hasNext(); ) {
+ UIComponent kid = (UIComponent)i.next();
+ if (kid instanceof UIScrollableGridColumn) {
+ UIScrollableGridColumn column = (UIScrollableGridColumn) kid;
+ chain.addIterator(column.getFacetIterator());
+ }
+ }
+
+ return chain;
+ }
+
}
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-05-07
15:33:02 UTC (rev 675)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-05-07
18:34:04 UTC (rev 676)
@@ -3,6 +3,8 @@
*/
package org.richfaces.component;
+import java.util.Iterator;
+
/**
* @author Anton Belevich
*
@@ -24,5 +26,13 @@
// TODO Auto-generated method stub
}
-
+
+ public Iterator getChildIterator(){
+ return getChildren().iterator();
+ }
+
+ public Iterator getFacetIterator() {
+ return getFacets().values().iterator();
+ }
+
}
Show replies by date