org.apache.tapestry.contrib.components
Class When

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

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.


evaluateCondition

protected boolean evaluateCondition()

getInvert

public boolean getInvert()

getChoose

public Choose getChoose()
Returns:
Choose

setChoose

public void setChoose(Choose value)
Sets the choose.

Parameters:
value - The choose to set