net.sf.tacos.ajax.components.tree
Class Tree

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by org.apache.tapestry.BaseComponent
              extended by net.sf.tacos.ajax.components.tree.Tree
All Implemented Interfaces:
PartialRenderBlock, Locatable, LocationHolder, org.apache.tapestry.IComponent, org.apache.tapestry.IDirect, org.apache.tapestry.IRender, org.apache.tapestry.ITemplateComponent

public abstract class Tree
extends org.apache.tapestry.BaseComponent
implements PartialRenderBlock, org.apache.tapestry.IDirect

Base component for providing Tree-like semantics for displaying data.

Author:
phraktle

Constructor Summary
Tree()
           
 
Method Summary
 void beforeRenderBody(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle, Serializable partId, boolean isRendering)
          Invoked before this blocks body is rendered.
 void contentExpansion(org.apache.tapestry.IRequestCycle cycle)
          Invoked by contentLinkToggle component, will invoke expansion(IRequestCycle) first before checking if the invoking component specified an IActionListener and any optional parameters it may need.
 void expansion(org.apache.tapestry.IRequestCycle cycle)
          Called to request the expansion of a tree node.
abstract  org.apache.tapestry.engine.IEngineService getAjaxEngine()
          Injected ajax engine
abstract  AjaxWebRequest getAjaxWebRequest()
          Injected ajax request
abstract  ITreeContentProvider getContentProvider()
          Injected content provider
 IKeyProvider getIdentityKeyProvider()
          The default IdentityKeyProvider.
abstract  IKeyProvider getKeyProvider()
          Injected key provider
abstract  org.apache.tapestry.IActionListener getLinkListener()
          Listener to invoke
abstract  org.apache.tapestry.listener.ListenerInvoker getListenerInvoker()
          For invoking linkToggleListener, if it exists
abstract  String getLoadElement()
          Delayed loading display element id
 ITreeManager getManager()
           
abstract  String getPartialBlockClass()
          Partial block class
 PartialRenderBlock getPartialTreeBlock()
          Used to pass self into PartialForeach.
 org.apache.tapestry.IMarkupWriter getPartWriter(Serializable partId)
          Returns the IMarkupWriter to use to print the contents of the specified part area.
abstract  org.apache.tapestry.bean.EvenOdd getRowStyle()
          Optional EvenOdd component
abstract  org.apache.tapestry.IScript getScript()
          Injected script
abstract  Comparator getSorter()
          Injected sort Comparator
abstract  Set getState()
          Gets default/specified state
 net.sf.tacos.ajax.components.tree.TreeIterator getTreeIterator()
          The default TreeIterator provided if no other is specified.
abstract  Object getValue()
          Current value being rendered
 void incrementNonRenderBlock()
          Called to give components a chance to increment anything they may be doing in a looping structure for part blocks that don't actually get called because they aren't in the current partial cycle.
abstract  boolean isDelayedLoad()
          Delayed loading parameter
 boolean isExpanded(Object element)
           
abstract  boolean isRowStyleInOuterDiv()
          Where to apply the row style
 boolean isStateful()
          
protected  void renderComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
          
abstract  void setState(Set state)
          Saves tree state
 void trigger(org.apache.tapestry.IRequestCycle cycle)
          
 
Methods inherited from class org.apache.tapestry.BaseComponent
addOuter, finishLoad
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, 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.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

Tree

public Tree()
Method Detail

getIdentityKeyProvider

public IKeyProvider getIdentityKeyProvider()
The default IdentityKeyProvider.

Returns:
The default key provider.

getTreeIterator

public net.sf.tacos.ajax.components.tree.TreeIterator getTreeIterator()
The default TreeIterator provided if no other is specified.

Returns:
Instance of TreeIterator

renderComponent

protected void renderComponent(org.apache.tapestry.IMarkupWriter writer,
                               org.apache.tapestry.IRequestCycle cycle)

Overrides:
renderComponent in class org.apache.tapestry.BaseComponent

expansion

public void expansion(org.apache.tapestry.IRequestCycle cycle)
Called to request the expansion of a tree node.

Parameters:
cycle -

contentExpansion

public void contentExpansion(org.apache.tapestry.IRequestCycle cycle)
Invoked by contentLinkToggle component, will invoke expansion(IRequestCycle) first before checking if the invoking component specified an IActionListener and any optional parameters it may need.

Parameters:
cycle -

isExpanded

public boolean isExpanded(Object element)
Parameters:
element - to test expanded of
Returns:
True if element should be displayed/expanded.

getManager

public ITreeManager getManager()
Returns:
The ITreeManager for this tree.

beforeRenderBody

public void beforeRenderBody(org.apache.tapestry.IMarkupWriter writer,
                             org.apache.tapestry.IRequestCycle cycle,
                             Serializable partId,
                             boolean isRendering)
Invoked before this blocks body is rendered.

Specified by:
beforeRenderBody in interface PartialRenderBlock
isRendering - True if render is being requested with a valid writer

incrementNonRenderBlock

public void incrementNonRenderBlock()
Called to give components a chance to increment anything they may be doing in a looping structure for part blocks that don't actually get called because they aren't in the current partial cycle.

Currently being used to increment things like EvenOdd tapestry beans.

Specified by:
incrementNonRenderBlock in interface PartialRenderBlock

getPartWriter

public org.apache.tapestry.IMarkupWriter getPartWriter(Serializable partId)
Returns the IMarkupWriter to use to print the contents of the specified part area. The returned writer doesn't necessarily need to be directly associated with the specified part.

Specified by:
getPartWriter in interface PartialRenderBlock
Parameters:
partId - The Part or area of contents unique id.
Returns:
A valid writer, or null if none are available.

getPartialTreeBlock

public PartialRenderBlock getPartialTreeBlock()
Used to pass self into PartialForeach.

Returns:

isStateful

public boolean isStateful()

Specified by:
isStateful in interface org.apache.tapestry.IDirect

trigger

public void trigger(org.apache.tapestry.IRequestCycle cycle)

Specified by:
trigger in interface org.apache.tapestry.IDirect

getScript

public abstract org.apache.tapestry.IScript getScript()
Injected script


getAjaxEngine

public abstract org.apache.tapestry.engine.IEngineService getAjaxEngine()
Injected ajax engine


getAjaxWebRequest

public abstract AjaxWebRequest getAjaxWebRequest()
Injected ajax request


getValue

public abstract Object getValue()
Current value being rendered


getState

public abstract Set getState()
Gets default/specified state


setState

public abstract void setState(Set state)
Saves tree state


getContentProvider

public abstract ITreeContentProvider getContentProvider()
Injected content provider


getKeyProvider

public abstract IKeyProvider getKeyProvider()
Injected key provider


getSorter

public abstract Comparator getSorter()
Injected sort Comparator


getRowStyle

public abstract org.apache.tapestry.bean.EvenOdd getRowStyle()
Optional EvenOdd component


isRowStyleInOuterDiv

public abstract boolean isRowStyleInOuterDiv()
Where to apply the row style


getPartialBlockClass

public abstract String getPartialBlockClass()
Partial block class


getListenerInvoker

public abstract org.apache.tapestry.listener.ListenerInvoker getListenerInvoker()
For invoking linkToggleListener, if it exists


getLinkListener

public abstract org.apache.tapestry.IActionListener getLinkListener()
Listener to invoke


isDelayedLoad

public abstract boolean isDelayedLoad()
Delayed loading parameter


getLoadElement

public abstract String getLoadElement()
Delayed loading display element id