net.sourceforge.stripes.tag.layout
Class LayoutComponentTag

java.lang.Object
  extended by net.sourceforge.stripes.tag.StripesTagSupport
      extended by net.sourceforge.stripes.tag.layout.LayoutTag
          extended by net.sourceforge.stripes.tag.layout.LayoutComponentTag
All Implemented Interfaces:
JspTag, Tag

public class LayoutComponentTag
extends LayoutTag

Defines a component in a layout. Used both to define the components in a layout definition and to provide overridden component definitions during a layout rendering request.

Since:
Stripes 1.1
Author:
Tim Fennell, Ben Gunter

Field Summary
 
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport
pageContext, parentTag
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LayoutComponentTag()
           
 
Method Summary
 int doEndTag()
          If this tag is the component that needs to be rendered, as indicated by LayoutContext.getComponent(), then set the current component name back to null to indicate that the component has rendered.
 int doStartTag()
           If this tag is nested within a LayoutDefinitionTag, then evaluate the corresponding LayoutComponentTag nested within the LayoutRenderTag that invoked the parent LayoutDefinitionTag.
 String getName()
          Gets the name of the component.
 boolean isCurrentComponent()
          True if this tag is the component to be rendered on this pass from LayoutDefinitionTag.
 void setName(String name)
          Sets the name of the component.
 void setPageContext(PageContext pageContext)
          Called by the Servlet container to set the page context on the tag.
 
Methods inherited from class net.sourceforge.stripes.tag.layout.LayoutTag
cleanUpComponentRenderers, exportComponentRenderers, getCurrentPagePath, getLayoutParent, isChildOfComponent, isChildOfDefinition, isChildOfRender
 
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, release, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutComponentTag

public LayoutComponentTag()
Method Detail

getName

public String getName()
Gets the name of the component.


setName

public void setName(String name)
Sets the name of the component.


setPageContext

public void setPageContext(PageContext pageContext)
Description copied from class: StripesTagSupport
Called by the Servlet container to set the page context on the tag.

Specified by:
setPageContext in interface Tag
Overrides:
setPageContext in class StripesTagSupport

isCurrentComponent

public boolean isCurrentComponent()
                           throws StripesJspException
True if this tag is the component to be rendered on this pass from LayoutDefinitionTag.

Throws:
StripesJspException - If a LayoutContext is not found.

doStartTag

public int doStartTag()
               throws JspException

If this tag is nested within a LayoutDefinitionTag, then evaluate the corresponding LayoutComponentTag nested within the LayoutRenderTag that invoked the parent LayoutDefinitionTag. If, after evaluating the corresponding tag, the component has not been rendered then evaluate this tag's body by returning EVAL_BODY_INCLUDE.

If this tag is nested within a LayoutRenderTag and this tag is the current component, as indicated by LayoutContext.getComponent(), then evaluate this tag's body by returning EVAL_BODY_INCLUDE.

In all other cases, skip this tag's body by returning SKIP_BODY.

Specified by:
doStartTag in interface Tag
Specified by:
doStartTag in class StripesTagSupport
Returns:
EVAL_BODY_INCLUDE or SKIP_BODY, as described above.
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
If this tag is the component that needs to be rendered, as indicated by LayoutContext.getComponent(), then set the current component name back to null to indicate that the component has rendered.

Specified by:
doEndTag in interface Tag
Specified by:
doEndTag in class StripesTagSupport
Returns:
SKIP_PAGE if this component is the current component, otherwise EVAL_PAGE.
Throws:
JspException


© Copyright 2005-2006, Stripes Development Team.