org.apache.tapestry.contrib.components
Class When

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.components.Conditional
              extended by org.apache.tapestry.contrib.components.When
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, org.apache.tapestry.IComponent, org.apache.tapestry.IRender

public abstract class When
extends org.apache.tapestry.components.Conditional

Represents an alternative whithin a Choose component. The default alternative is described by the Otherwise component. [Component Reference]

Author:
David Solis

Constructor Summary
When()
           
 
Method Summary
protected  boolean evaluateCondition()
           
 Choose getChoose()
           
 boolean getInvert()
           
protected  void renderComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          Renders its wrapped components only if the condition is true and its parent Choose allows it.
 void setChoose(Choose value)
          Sets the choose.
 
Methods inherited from class org.apache.tapestry.components.Conditional
getCondition, getElement
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.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.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

When

public When()
Method Detail

renderComponent

protected void renderComponent(org.apache.tapestry.IMarkupWriter writer,
                               org.apache.tapestry.IRequestCycle cycle)
Renders its wrapped components only if the condition is true and its parent Choose allows it. In addition, if element is specified, can emulate that HTML element.

Overrides:
renderComponent in class org.apache.tapestry.components.Conditional

evaluateCondition

protected boolean evaluateCondition()
Overrides:
evaluateCondition in class org.apache.tapestry.components.Conditional

getInvert

public boolean getInvert()
Specified by:
getInvert in class org.apache.tapestry.components.Conditional

getChoose

public Choose getChoose()
Returns:
Choose

setChoose

public void setChoose(Choose value)
Sets the choose.

Parameters:
value - The choose to set