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

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

protected class CheckboxTree.BaseCheckboxJavascriptRenderer
extends Tree.AbstractJavascriptRenderer
implements CheckboxTree.CheckboxJavascriptRenderer

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

Provides a base implementation of a CheckboxJavascriptRenderer that subclasses can extend from.


Field Summary
protected  String checkboxId
          holds the id of the checkbox html element.
protected  String checkboxOnClickString
          holds the javascript call when user clicks on checkbox.
protected  String nodeSelectionString
          holds the javascript call to select the node.
protected  String selectId
          holds the id of the select html element.
 
Fields inherited from class org.apache.click.extras.tree.Tree.AbstractJavascriptRenderer
expandId, iconId, nodeExpansionString
 
Constructor Summary
protected CheckboxTree.BaseCheckboxJavascriptRenderer()
           
 
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

selectId

protected String selectId
holds the id of the select html element.


nodeSelectionString

protected String nodeSelectionString
holds the javascript call to select the node.


checkboxId

protected String checkboxId
holds the id of the checkbox html element.


checkboxOnClickString

protected String checkboxOnClickString
holds the javascript call when user clicks on checkbox.

Constructor Detail

CheckboxTree.BaseCheckboxJavascriptRenderer

protected CheckboxTree.BaseCheckboxJavascriptRenderer()
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.AbstractJavascriptRenderer
Parameters:
treeNode - the current node rendered
See Also:
init(TreeNode)