net.sf.tacos.tree
Class Tree

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

public abstract class Tree
extends BaseComponent
implements PartialRenderBlock

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

Author:
phraktle

Constructor Summary
Tree()
           
 
Method Summary
 void beforeRenderBody(IMarkupWriter writer, IRequestCycle cycle, Serializable partId, boolean isRendering)
          Invoked before this blocks body is rendered.
 void contentExpansion(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(IRequestCycle cycle)
          Called to request the expansion of a tree node.
abstract  ITreeContentProvider getContentProvider()
          Injected content provider
 IKeyProvider getIdentityKeyProvider()
          The default IdentityKeyProvider.
abstract  IKeyProvider getKeyProvider()
          Injected key provider
abstract  IActionListener getLinkListener()
          Listener to invoke
abstract  ListenerInvoker getListenerInvoker()
          For invoking linkToggleListener, if it exists
 ITreeManager getManager()
           
 PartialRenderBlock getPartialTreeBlock()
          Used to pass self into PartialForeach.
 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.
abstract  EvenOdd getRowStyle()
          Optional EvenOdd component
abstract  Comparator getSorter()
          Injected sort Comparator
abstract  Set getState()
          Gets default/specified state
 net.sf.tacos.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.

Currently being used to increment things like EvenOdd tapestry beans.

 boolean isExpanded(Object element)
           
protected  void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          
abstract  void setState(Set state)
          Saves tree state
 
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, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, 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, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, 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.tree.TreeIterator getTreeIterator()
The default TreeIterator provided if no other is specified.

Returns:
Instance of TreeIterator

renderComponent

protected void renderComponent(IMarkupWriter writer,
                               IRequestCycle cycle)


expansion

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

Parameters:
cycle -

contentExpansion

public void contentExpansion(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(IMarkupWriter writer,
                             IRequestCycle cycle,
                             Serializable partId,
                             boolean isRendering)
Invoked before this blocks body is rendered.

Specified by:
beforeRenderBody in interface PartialRenderBlock
Parameters:
writer -
cycle -
partId -
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 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:

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 EvenOdd getRowStyle()
Optional EvenOdd component


getListenerInvoker

public abstract ListenerInvoker getListenerInvoker()
For invoking linkToggleListener, if it exists


getLinkListener

public abstract IActionListener getLinkListener()
Listener to invoke