net.sourceforge.stripes.tag.layout
Class LayoutDefinitionTag

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

public class LayoutDefinitionTag
extends StripesTagSupport

On the surface, allows a developer to define a layout using a custom tag - but is actually the tag responsible for generating the output of the layout. A layout can have zero or more nested components, as well as regular text and other custom tags nested within it.

Since:
Stripes 1.1
Author:
Tim Fennell

Field Summary
static String PREFIX
          Prefix used to construct the request attribute name used to pass context from the LayoutRenderTag to the LayoutDefinitionTag.
 
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
LayoutDefinitionTag()
           
 
Method Summary
 int doEndTag()
          Causes page evaluation to end once the end of the layout definition is reached.
 int doStartTag()
          Looks up the layout context that has been setup by a LayoutRenderTag.
 boolean permissionToRender(String componentName)
          Called by nested tags to find out if they have permission to render their content, or if they have been overridden in the layout rendering tag.
 
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
 

Field Detail

PREFIX

public static final String PREFIX
Prefix used to construct the request attribute name used to pass context from the LayoutRenderTag to the LayoutDefinitionTag.

See Also:
Constant Field Values
Constructor Detail

LayoutDefinitionTag

public LayoutDefinitionTag()
Method Detail

doStartTag

public int doStartTag()
               throws JspException
Looks up the layout context that has been setup by a LayoutRenderTag. Uses the context to push any dynamic attributes supplied to the render tag in to the page context available during the body of the LayoutDefinitionTag.

Specified by:
doStartTag in interface Tag
Specified by:
doStartTag in class StripesTagSupport
Returns:
EVAL_BODY_INCLUDE in all cases.
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Causes page evaluation to end once the end of the layout definition is reached.

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

permissionToRender

public boolean permissionToRender(String componentName)
                           throws JspException
Called by nested tags to find out if they have permission to render their content, or if they have been overridden in the layout rendering tag. Returns true if a component has not been overridden and should render as normal. Returns false, and writes out the overridden component when the component has been overridden.

Parameters:
componentName - the name of the component about to render
Returns:
true if the component should render itself, false otherwise
Throws:
JspException - if the JspWriter could not be written to


? Copyright 2005-2006, Stripes Development Team.