Author: nbelaevski
Date: 2010-10-31 13:05:52 -0400 (Sun, 31 Oct 2010)
New Revision: 19801
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
Log:
https://jira.jboss.org/browse/RF-9315
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java
===================================================================
---
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-10-31
17:00:29 UTC (rev 19800)
+++
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/component/TreeRange.java 2010-10-31
17:05:52 UTC (rev 19801)
@@ -45,7 +45,7 @@
traverseAll = SwitchType.client == tree.getToggleMode();
}
- public boolean processNodeChildren(Object rowKey) {
+ public boolean shouldIterateChildren(Object rowKey) {
if (traverseAll) {
return true;
}
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java
===================================================================
---
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java 2010-10-31
17:00:29 UTC (rev 19800)
+++
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/model/TreeDataModelImpl.java 2010-10-31
17:05:52 UTC (rev 19801)
@@ -160,7 +160,7 @@
DataVisitResult visitResult = visitor.process(context, object, argument);
if (visitResult == DataVisitResult.CONTINUE) {
- if (((TreeRange) range).processNodeChildren(object)) {
+ if (((TreeRange) range).shouldIterateChildren(object)) {
Iterator<Object> childrenIterator =
getChildrenIterator(context, object);
walk(context, visitor, range, argument, childrenIterator);
}
@@ -175,7 +175,7 @@
public void walk(FacesContext context, DataVisitor visitor, Range range, Object
argument) {
// TODO Auto-generated method stub
- if (((TreeRange) range).processNodeChildren(null)) {
+ if (((TreeRange) range).shouldIterateChildren(null)) {
Iterator<Object> iterator = getChildrenIterator(context, null);
walk(context, visitor, range, argument, iterator);
}
Modified:
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
---
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-10-31
17:00:29 UTC (rev 19800)
+++
sandbox/trunk/ui/tree-actual/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-10-31
17:05:52 UTC (rev 19801)
@@ -29,7 +29,7 @@
import javax.faces.context.ResponseWriter;
import org.richfaces.component.AbstractTree;
-import org.richfaces.component.SwitchType;
+import org.richfaces.component.TreeRange;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.renderkit.TreeRendererBase.NodeState;
import org.richfaces.renderkit.TreeRendererBase.QueuedData;
@@ -50,7 +50,7 @@
protected final AbstractTree tree;
- private boolean traverseCollapsedNode;
+ private TreeRange treeRange;
private LinkedList<QueuedData> queuedData = new
LinkedList<QueuedData>();
@@ -60,7 +60,7 @@
this.responseWriter = context.getResponseWriter();
this.tree = tree;
- this.traverseCollapsedNode = SwitchType.client.equals(tree.getToggleMode());
+ this.treeRange = (TreeRange) tree.getComponentState().getRange();
}
protected void encodeTree(Iterator<Object> childrenIterator) throws IOException
{
@@ -101,7 +101,7 @@
boolean expanded = tree.isExpanded();
queuedData.add(new QueuedData(rowKey, isLastNode, expanded));
- boolean iterateChildren = traverseCollapsedNode || expanded;
+ boolean iterateChildren = treeRange.shouldIterateChildren(rowKey);
if (iterateChildren) {
encodeTree(tree.getChildrenIterator(context, rowKey));