KickJava   Java API By Example, From Geeks To Geeks.

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


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
12
13 import javax.servlet.jsp.JspTagException JavaDoc;
14 import javax.servlet.jsp.JspException JavaDoc;
15 import org.mmbase.bridge.jsp.taglib.Writer;
16
17
18 /**
19  * @author Michiel Meeuwissen
20  * @since MMBase-1.7
21  * @version $Id: DepthTag.java,v 1.4 2005/03/14 19:02:35 michiel Exp $
22  */

23 public class DepthTag extends TreeReferrerTag implements Writer {
24
25     public int doStartTag() throws JspTagException JavaDoc {
26         DepthProvider dp = (DepthProvider) findParentTag(DepthProvider.class, (String JavaDoc) parentTreeId.getValue(this));
27         helper.setValue(new Integer JavaDoc(dp.getDepth()));
28         if (getId() != null) {
29             getContextProvider().getContextContainer().register(getId(), helper.getValue());
30         }
31         return EVAL_BODY_BUFFERED;
32     }
33
34     public int doAfterBody() throws JspException JavaDoc {
35         return helper.doAfterBody();
36     }
37
38     public int doEndTag() throws JspTagException JavaDoc {
39         helper.doEndTag();
40         return super.doEndTag();
41     }
42
43 }
44
45
Popular Tags