net.sourceforge.stripes.tag.layout
Class LayoutComponentTag

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

public class LayoutComponentTag
extends StripesTagSupport
implements BodyTag

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

Field Summary
 
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport
pageContext, parentTag
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
LayoutComponentTag()
           
 
Method Summary
 int doAfterBody()
          Does nothing.
 int doEndTag()
          If the tag is nested in a LayoutRenderTag, provides the tag with the generated contents.
 void doInitBody()
          Does nothing.
 int doStartTag()
          Behaviour varies depending on whether the tag is nested inside a LayoutRenderTag or a LayoutDefinitionTag.
 String getName()
          Gets the name of the component.
 void setBodyContent(BodyContent bodyContent)
          Save the body content output by the tag.
 void setName(String name)
          Sets the name of the component.
 
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, release, setPageContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, release, setPageContext, setParent
 

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.


setBodyContent

public void setBodyContent(BodyContent bodyContent)
Save the body content output by the tag.

Specified by:
setBodyContent in interface BodyTag

doStartTag

public int doStartTag()
               throws JspException
Behaviour varies depending on whether the tag is nested inside a LayoutRenderTag or a LayoutDefinitionTag. In the first case it will always render it's output to a buffer so that it can be provided to the render tag. In the second case, checks to see if the component has been overridden. If so, does nothing, else writes its content to the output stream.

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

doInitBody

public void doInitBody()
                throws JspException
Does nothing.

Specified by:
doInitBody in interface BodyTag
Throws:
JspException

doAfterBody

public int doAfterBody()
                throws JspException
Does nothing.

Specified by:
doAfterBody in interface IterationTag
Returns:
SKIP_BODY in all cases.
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
If the tag is nested in a LayoutRenderTag, provides the tag with the generated contents. Otherwise, does nothing.

Specified by:
doEndTag in interface Tag
Specified by:
doEndTag in class StripesTagSupport
Returns:
EVAL_PAGE in all cases.
Throws:
JspException


? Copyright 2005-2006, Stripes Development Team.