Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree
In directory james.mmbase.org:/tmp/cvs-serv29174
Modified Files:
TreeTag.java
Log Message:
MMB-1611. Changed fixe a bit, and provide now a list of LoopTagStatuses
See also:
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree
See also: http://www.mmbase.org/jira/browse/MMB-1611
Index: TreeTag.java
===================================================================
RCS file:
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/tree/TreeTag.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- TreeTag.java 28 Feb 2008 12:22:59 -0000 1.25
+++ TreeTag.java 29 Feb 2008 13:19:35 -0000 1.26
@@ -14,7 +14,7 @@
import javax.servlet.jsp.jstl.core.*;
import java.io.IOException;
-import java.util.Stack;
+import java.util.*;
import org.mmbase.bridge.util.*;
import org.mmbase.bridge.*;
@@ -48,7 +48,7 @@
</pre>
* @author Michiel Meeuwissen
* @since MMBase-1.7
- * @version $Id: TreeTag.java,v 1.25 2008/02/28 12:22:59 michiel Exp $
+ * @version $Id: TreeTag.java,v 1.26 2008/02/29 13:19:35 michiel Exp $
*/
public class TreeTag extends AbstractNodeProviderTag implements TreeProvider,
QueryContainerReferrer {
private static final Logger log = Logging.getLoggerInstance(TreeTag.class);
@@ -66,6 +66,7 @@
private Node nextNode;
private BranchLoopStatus nextBranchStatus;
+ private List<BranchLoopStatus> branchLoopStatus;
private Object prevDepthProvider;
private Object prevTreeProvider;
@@ -224,6 +225,9 @@
varStatusName = (String) varStatus.getValue(this);
varBranchStatusName = (String) varBranchStatus.getValue(this);
+ if (varBranchStatusName != null) {
+ branchLoopStatus = new ArrayList();
+ }
// serve parent timer tag:
TimerTag t = findParentTag(TimerTag.class, null, false);
@@ -296,7 +300,9 @@
}
if (varBranchStatusName != null) {
org.mmbase.bridge.jsp.taglib.util.ContextContainer cc =
getContextProvider().getContextContainer();
- cc.register(varBranchStatusName, new BranchLoopStatus(node,
iterator.getSiblings()));
+ while (branchLoopStatus.size() < depth)
branchLoopStatus.add(null);
+ branchLoopStatus.set(depth - 1, new BranchLoopStatus(node,
iterator.getSiblings()));
+ cc.register(varBranchStatusName, branchLoopStatus.subList(0,
depth));
}
if (iterator.hasNext()) {
@@ -347,7 +353,9 @@
}
if (varBranchStatusName != null) {
org.mmbase.bridge.jsp.taglib.util.ContextContainer cc =
getContextProvider().getContextContainer();
- cc.reregister(varBranchStatusName, nextBranchStatus);
+ while (branchLoopStatus.size() < depth)
branchLoopStatus.add(null);
+ branchLoopStatus.set(depth - 1, nextBranchStatus);
+ cc.reregister(varBranchStatusName, branchLoopStatus.subList(0,
depth));
}
previousDepth = depth;
depth = nextDepth;
@@ -399,9 +407,11 @@
iterator = null;
shrinkStack = null;
nextNode = null;
+ nextBranchStatus = null;
collector = null;
prevDepthProvider = null;
prevTreeProvider = null;
+ branchLoopStatus = null;
return super.doEndTag();
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs