org.apache.click.extras.tree
Class CheckboxTree.CheckboxSessionJavascriptRenderer

java.lang.Object
  extended by org.apache.click.extras.tree.Tree.AbstractJavascriptRenderer
      extended by org.apache.click.extras.tree.Tree.SessionRenderer
          extended by org.apache.click.extras.tree.CheckboxTree.CheckboxSessionJavascriptRenderer
All Implemented Interfaces:
CheckboxTree.CheckboxJavascriptRenderer, Tree.JavascriptRenderer
Enclosing class:
CheckboxTree

protected class CheckboxTree.CheckboxSessionJavascriptRenderer
extends Tree.SessionRenderer
implements CheckboxTree.CheckboxJavascriptRenderer

Please note this class is only meant for developers of this control, not users.

Provides the rendering needed when a Tree.JAVASCRIPT_SESSION_POLICY is in effect.


Field Summary
protected  CheckboxTree.BaseCheckboxJavascriptRenderer checkboxRenderer
          A delegate for javascript rendering.
 
Fields inherited from class org.apache.click.extras.tree.Tree.AbstractJavascriptRenderer
expandId, iconId, nodeExpansionString
 
Constructor Summary
protected CheckboxTree.CheckboxSessionJavascriptRenderer()
           
 
Method Summary
 void init(TreeNode treeNode)
          Called to initialize the renderer.
 void renderCheckbox(HtmlStringBuffer buffer)
          Called when a tree node's checkbox is rendered.
 void renderSelect(HtmlStringBuffer buffer)
          Called when a tree node's selected state is rendered.
 void renderValue(HtmlStringBuffer buffer)
          Called when a tree node's value is rendered.
 
Methods inherited from class org.apache.click.extras.tree.Tree.AbstractJavascriptRenderer
buildString, renderExpandAndCollapseAction, renderIcon, renderTreeNodeStart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkboxRenderer

protected CheckboxTree.BaseCheckboxJavascriptRenderer checkboxRenderer
A delegate for javascript rendering.

Constructor Detail

CheckboxTree.CheckboxSessionJavascriptRenderer

protected CheckboxTree.CheckboxSessionJavascriptRenderer()
Method Detail

renderValue

public void renderValue(HtmlStringBuffer buffer)
Description copied from interface: CheckboxTree.CheckboxJavascriptRenderer
Called when a tree node's value is rendered. Enables the renderer to add attributes needed by javascript functionality for example something like:
      buffer.append("onclick=\"handleNodeSelection(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 renderValue is called.

Specified by:
renderValue in interface CheckboxTree.CheckboxJavascriptRenderer
Parameters:
buffer - string buffer containing the markup
See Also:
renderValue(HtmlStringBuffer)

renderSelect

public void renderSelect(HtmlStringBuffer buffer)
Description copied from interface: CheckboxTree.CheckboxJavascriptRenderer
Called when a tree node's selected state is rendered. Enables the renderer to add attributes needed by javascript functionality for example something like:
     buffer.appendAttribute("id", selectId);
 
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 renderSelect is called.

Specified by:
renderSelect in interface CheckboxTree.CheckboxJavascriptRenderer
Parameters:
buffer - string buffer containing the markup
See Also:
renderSelect(HtmlStringBuffer)

renderCheckbox

public void renderCheckbox(HtmlStringBuffer buffer)
Description copied from interface: CheckboxTree.CheckboxJavascriptRenderer
Called when a tree node's checkbox is rendered. Enables the renderer to add attributes needed by javascript functionality for example:
     buffer.append(" onclick=\"onCheckboxClick(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 renderValue is called.

Specified by:
renderCheckbox in interface CheckboxTree.CheckboxJavascriptRenderer
Parameters:
buffer - string buffer containing the markup
See Also:
renderCheckbox(HtmlStringBuffer)

init

public void init(TreeNode treeNode)
Description copied from interface: Tree.JavascriptRenderer
Called to initialize the renderer.

Specified by:
init in interface Tree.JavascriptRenderer
Overrides:
init in class Tree.SessionRenderer
Parameters:
treeNode - the current node rendered
See Also:
init(TreeNode)