| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.click.extras.tree.Tree.AbstractJavascriptRenderer
protected abstract class Tree.AbstractJavascriptRenderer
Please note this class is not meant for public use.
Provides a abstract implementation of JavascriptRenderer that subclasses can extend from.
| Field Summary | |
|---|---|
| protected  String | expandIdholds the id of the expand html element. | 
| protected  String | iconIdholds the id of the icon html element. | 
| protected  String | nodeExpansionStringholds the javascript call to expand or collapse the node. | 
| Constructor Summary | |
|---|---|
| protected  | Tree.AbstractJavascriptRenderer() | 
| Method Summary | |
|---|---|
| protected  String | buildString(String prefix,
            String infix,
            String postfix)Builds a new string consisting of a prefix, infix and postfix. | 
|  void | init(TreeNode treeNode)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. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected String expandId
protected String iconId
protected String nodeExpansionString
| Constructor Detail | 
|---|
protected Tree.AbstractJavascriptRenderer()
| Method Detail | 
|---|
public void init(TreeNode treeNode)
Tree.JavascriptRenderer
init in interface Tree.JavascriptRenderertreeNode - the current node renderedinit(TreeNode), 
init(TreeNode)public void renderTreeNodeStart(HtmlStringBuffer buffer)
Tree.JavascriptRenderer
      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.
renderTreeNodeStart in interface Tree.JavascriptRendererbuffer - string buffer containing the markuprenderTreeNodeStart(HtmlStringBuffer)public void renderExpandAndCollapseAction(HtmlStringBuffer buffer)
Tree.JavascriptRenderer
      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.
renderExpandAndCollapseAction in interface Tree.JavascriptRendererbuffer - string buffer containing the markuprenderExpandAndCollapseAction(HtmlStringBuffer)public void renderIcon(HtmlStringBuffer buffer)
Tree.JavascriptRenderer
      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.
renderIcon in interface Tree.JavascriptRendererbuffer - string buffer containing the markuprenderIcon(HtmlStringBuffer)
protected String buildString(String prefix,
                             String infix,
                             String postfix)
prefix - the string to append at the start of new stringinfix - the string to append in the middle of the new stringpostfix - the string to append at the end of the new string
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||