1 18 package org.apache.beehive.netui.tags.tree; 19 20 import org.apache.beehive.netui.tags.AbstractSimpleTag; 21 import org.apache.beehive.netui.util.logging.Logger; 22 23 import javax.servlet.jsp.JspException ; 24 import java.io.IOException ; 25 26 34 public class TreeLabel extends AbstractSimpleTag 35 { 36 private static final Logger logger = Logger.getInstance(TreeLabel.class); 37 38 private String _text; 39 40 43 public String getTagName() 44 { 45 return "TreeLabel"; 46 } 47 48 52 public void doTag() 53 throws JspException , IOException 54 { 55 String value = getBufferBody(true); 56 if (value.length() > 0) 57 _text = value; 58 59 Object o = getParent(); 60 assert (o != null); 61 if (!(o instanceof TreeItem)) { 62 logger.error("Invalid Parent (expected a TreeItem):" + o.getClass().getName()); 63 return; 64 } 65 66 TreeItem ti = (TreeItem) o; 68 ti.setItemLabel(_text); 69 } 70 } 71 | Popular Tags |