org.apache.click.extras.tree
Interface Tree.JavascriptRenderer

All Known Implementing Classes:
CheckboxTree.BaseCheckboxJavascriptRenderer, CheckboxTree.CheckboxCookieJavascriptRenderer, CheckboxTree.CheckboxSessionJavascriptRenderer, Tree.AbstractJavascriptRenderer, Tree.CookieRenderer, Tree.SessionRenderer
Enclosing class:
Tree

protected static interface Tree.JavascriptRenderer

Please note this class is not meant for public use.

Provides the contract for pluggable javascript renderers for the Tree.


Method Summary
 void init(TreeNode node)
          Called to initialize the renderer.
 void renderExpandAndCollapseAction(HtmlStringBuffer buffer)
          Called when the expand and collapse action is rendered.
 void renderIcon(HtmlStringBuffer buffer)
          Called when the tree icon is rendered.
 void renderTreeNodeStart(HtmlStringBuffer buffer)
          Called before a tree node is rendered.
 

Method Detail

init

void init(TreeNode node)
Called to initialize the renderer.

Parameters:
node - the current node rendered

renderTreeNodeStart

void renderTreeNodeStart(HtmlStringBuffer buffer)
Called before a tree node is rendered. Enables the renderer to add attributes needed by javascript functionality for example something like:
      buffer.appendAttribute("id",expandId);
 
The code above adds a id attribute to the element, to enable the javascript code to lookup the html element by its id.

The above attribute is appended to whichever element the tree is currently rendering at the time renderTreeNodeStart is called.

Parameters:
buffer - string buffer containing the markup

renderExpandAndCollapseAction

void renderExpandAndCollapseAction(HtmlStringBuffer buffer)
Called when the expand and collapse action is rendered. Enables the renderer to add attributes needed by javascript functionality for example something like:
      buffer.append("onclick=\"handleNodeExpansion(this,event)\"");
 
The code above adds a javascript function call to the element.

The code above is appended to whichever element the tree is currently rendering at the time renderTreeNodeStart is called.

Parameters:
buffer - string buffer containing the markup

renderIcon

void renderIcon(HtmlStringBuffer buffer)
Called when the tree icon is rendered. Enables the renderer to add attributes needed by javascript functionality for example something like:
      buffer.appendAttribute("id",iconId);
 
The code above adds a id attribute to the element, to enable the javascript code to lookup the html element by its id.

The above attribute is appended to whichever element the tree is currently rendering at the time renderTreeNodeStart is called.

Parameters:
buffer - string buffer containing the markup