1 package com.blandware.atleap.webapp.taglib.core.menu.context; 2 3 import javax.servlet.jsp.JspException ; 4 import javax.servlet.jsp.JspTagException ; 5 import javax.servlet.jsp.tagext.JspFragment ; 6 import javax.servlet.jsp.tagext.SimpleTagSupport ; 7 import java.io.IOException ; 8 9 26 public class ItemLabelTag extends SimpleTagSupport { 27 28 31 public ItemLabelTag() { 32 } 33 34 40 public void doTag() throws JspException , IOException { 41 ItemPart part = (ItemPart) findAncestorWithClass(this, ItemPart.class); 43 if ( part == null ) { 44 throw new JspTagException ("This tag is only valid when nested within 'itemEnabled' or 'itemDisabled' tag"); 45 } 46 47 if ( part.getRenderingFlag() == ItemPart.FLAG_RENDER_TO_MENU ) { 48 JspFragment body = getJspBody(); 50 if ( body != null ) { 51 body.invoke(null); 52 } 53 } 54 55 } 56 57 } 58 | Popular Tags |