Author: nbelaevski
Date: 2008-05-15 15:32:10 -0400 (Thu, 15 May 2008)
New Revision: 8609
Modified:
trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
Log:
UITree: compatibility fix for changes introduced with
http://jira.jboss.com/jira/browse/RF-3410
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-05-15 18:20:40
UTC (rev 8608)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/UITree.java 2008-05-15 19:32:10
UTC (rev 8609)
@@ -22,6 +22,8 @@
package org.richfaces.component;
import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
@@ -51,7 +53,6 @@
import org.ajax4jsf.model.Range;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.RendererUtils;
-import org.apache.commons.collections.iterators.SingletonIterator;
import org.richfaces.component.events.TreeEvents;
import org.richfaces.component.state.TreeState;
import org.richfaces.component.state.events.CollapseAllCommandEvent;
@@ -482,8 +483,15 @@
}
- protected Iterator dataChildren() {
- return new SingletonIterator(getNodeFacet());
+ protected Iterator<UIComponent> dataChildren() {
+ Collection<UIComponent> children;
+ if (!isRowAvailable()) {
+ children = Collections.emptyList();
+ } else {
+ children = Collections.singletonList((UIComponent) getNodeFacet());
+ }
+
+ return children.iterator();
}
/**
@@ -525,7 +533,7 @@
treeState.setSelected((TreeRowKey) this.getRowKey());
}
- protected Iterator fixedChildren() {
+ protected Iterator<UIComponent> fixedChildren() {
return getFacets().values().iterator();
}