1 10 package org.mmbase.bridge.jsp.taglib.tree; 11 import java.util.Stack ; 12 13 import javax.servlet.jsp.*; 14 15 import org.mmbase.util.logging.*; 16 21 public class OnShrinkTag extends TreeReferrerTag implements DepthProvider { 22 private static final Logger log = Logging.getLoggerInstance(OnShrinkTag.class); 23 private int depth; 24 25 public int getDepth() { 26 return depth; 27 } 28 29 public int doStartTag() throws JspTagException { 30 DepthProvider dp = (DepthProvider) findParentTag(DepthProvider.class, (String ) parentTreeId.getValue(this)); 31 depth = dp.getDepth(); 32 return EVAL_BODY_BUFFERED; 33 } 34 35 36 public int doAfterBody() throws JspException { 37 TreeProvider tp = findTreeProvider(); 38 Stack stack = tp.getShrinkStack(); 39 String body = bodyContent != null ? bodyContent.getString() : ""; 40 stack.push(new ShrinkTag.Entry(depth, body)); 41 if (log.isDebugEnabled()) { 42 log.debug("onshrink " + depth + " " + body); 43 } 44 return super.doAfterBody(); 45 } 46 47 48 } 49 50 | Popular Tags |