org.apache.tapestry.contrib.components
Class Choose

java.lang.Object
  extended by org.apache.tapestry.spec.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.components.Conditional
              extended by org.apache.tapestry.contrib.components.Choose
All Implemented Interfaces:
IComponent, ILocatable, ILocationHolder, IRender

public abstract class Choose
extends Conditional

This component is a container for When or Otherwise components; it provides the context for mutually exclusive conditional evaluation. [Component Reference]

Version:
$Id: Choose.java 243893 2004-04-18 00:50:28Z dsolis $
Author:
David Solis

Constructor Summary
Choose()
           
 
Method Summary
 void addBody(IRender element)
          Adds an element (which may be static text or a component) as a body element of this component.
protected  void cleanupAfterRender(IRequestCycle cycle)
          Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) after the component renders, to clear any parameters back to null (or 0, or false, or whatever the correct default is).
protected  boolean evaluateCondition()
           
abstract  boolean getCondition()
           
 boolean getInvert()
           
abstract  boolean isConditionMet()
           
abstract  void setConditionMet(boolean value)
           
 
Methods inherited from class org.apache.tapestry.components.Conditional
getElement, renderComponent
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addComponent, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
getLocation
 

Constructor Detail

Choose

public Choose()
Method Detail

addBody

public void addBody(IRender element)
Description copied from class: AbstractComponent
Adds an element (which may be static text or a component) as a body element of this component. Such elements are rendered by AbstractComponent.renderBody(IMarkupWriter, IRequestCycle).

Specified by:
addBody in interface IComponent
Overrides:
addBody in class AbstractComponent

cleanupAfterRender

protected void cleanupAfterRender(IRequestCycle cycle)
Description copied from class: AbstractComponent
Invoked by AbstractComponent.render(IMarkupWriter, IRequestCycle) after the component renders, to clear any parameters back to null (or 0, or false, or whatever the correct default is). Primarily, this is used to ensure that the component doesn't hold onto any objects that could otherwise be garbage collected.

Subclasses may override this implementation, but must also invoke it.

Overrides:
cleanupAfterRender in class AbstractComponent

evaluateCondition

protected boolean evaluateCondition()
Overrides:
evaluateCondition in class Conditional

getInvert

public boolean getInvert()
Specified by:
getInvert in class Conditional

getCondition

public abstract boolean getCondition()
Specified by:
getCondition in class Conditional

isConditionMet

public abstract boolean isConditionMet()

setConditionMet

public abstract void setConditionMet(boolean value)