org.apache.tapestry.contrib.components
Class When

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.When
All Implemented Interfaces:
IComponent, ILocatable, ILocationHolder, IRender

public abstract class When
extends Conditional

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

Version:
$Id: When.java 243791 2004-02-19 17:38:13Z hlship $
Author:
David Solis

Constructor Summary
When()
           
 
Method Summary
protected  boolean evaluateCondition()
           
 Choose getChoose()
           
 boolean getInvert()
           
protected  void renderComponent(IMarkupWriter writer, 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, cleanupAfterRender, 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

When

public When()
Method Detail

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               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 Conditional

evaluateCondition

protected boolean evaluateCondition()
Overrides:
evaluateCondition in class Conditional

getInvert

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

getChoose

public Choose getChoose()
Returns:
Choose

setChoose

public void setChoose(Choose value)
Sets the choose.

Parameters:
value - The choose to set