KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > bridge > jsp > taglib > tree > AbstractTreeReferrerListTag


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.bridge.jsp.taglib.tree;
11 import javax.servlet.jsp.JspTagException JavaDoc;
12
13 import org.mmbase.bridge.jsp.taglib.ListProvider;
14 import org.mmbase.bridge.jsp.taglib.util.*;
15
16 /**
17  * @author Michiel Meeuwissen
18  * @since MMBase-1.7
19  * @version $Id: AbstractTreeReferrerListTag.java,v 1.5 2005/12/05 17:21:17 michiel Exp $
20  */

21 abstract class AbstractTreeReferrerListTag extends TreeReferrerTag implements ListProvider, DepthProvider {
22
23     protected int depth;
24     protected int index;
25     protected TreeProvider tree;
26
27
28     public int getIndex() {
29         return index;
30     }
31     public int getIndexOffset() {
32         return 0;
33     }
34     public boolean isChanged() {
35         return true;
36     }
37     public Object JavaDoc getCurrent() {
38         return new Integer JavaDoc(depth);
39     }
40     public void remove() {
41         // not supported
42
}
43
44     public int getDepth() {
45         return depth;
46     }
47
48     protected ContextCollector collector;
49
50     // ContextProvider implementation
51

52     public ContextContainer getContextContainer() throws JspTagException JavaDoc {
53         return collector.getContextContainer();
54     }
55
56
57     protected final void doStartTagHelper() throws JspTagException JavaDoc {
58         collector = new ContextCollector(getContextProvider());
59         tree = findTreeProvider();
60         index = 0;
61     }
62
63     public int doEndTag() throws JspTagException JavaDoc {
64         collector = null;
65         tree = null;
66         return super.doEndTag();
67     }
68     public javax.servlet.jsp.jstl.core.LoopTagStatus getLoopStatus() {
69         return new ListProviderLoopTagStatus(this);
70     }
71
72
73 }
74
75
Popular Tags