public class HtmlTreeRenderer
extends javax.faces.render.Renderer
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
ROOT_NODE_ID |
protected static java.lang.String |
TOGGLE_SPAN |
| Constructor and Description |
|---|
HtmlTreeRenderer() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterNodeEncode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out) |
protected void |
beforeNodeEncode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree) |
void |
decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component) |
void |
encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Renders the whole tree.
|
protected void |
encodeCurrentNode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree)
Encodes the current node.
|
protected void |
encodeTree(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree,
java.lang.String parentId,
int childCount)
Encodes the tree and its children.
|
protected boolean |
getBoolean(javax.faces.component.UIComponent component,
java.lang.String attributeName,
boolean defaultValue)
Helper method for getting the boolean value of an attribute.
|
boolean |
getRendersChildren() |
protected static final java.lang.String TOGGLE_SPAN
protected static final java.lang.String ROOT_NODE_ID
public boolean getRendersChildren()
getRendersChildren in class javax.faces.render.Rendererpublic void decode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
decode in class javax.faces.render.Rendererpublic void encodeBegin(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws java.io.IOException
encodeBegin in class javax.faces.render.Rendererjava.io.IOExceptionpublic void encodeChildren(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
throws java.io.IOException
<span> element with an id
attribute if the component has been given an explicit ID. The model nodes are rendered
recursively by the private encodeNodes method.encodeChildren in class javax.faces.render.Renderercontext - FacesContextcomponent - The component whose children are to be renderedjava.io.IOExceptionprotected void encodeTree(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree,
java.lang.String parentId,
int childCount)
throws java.io.IOException
context - FacesContextout - ResponseWritertree - HtmlTreeparentId - The parent's node id (where parent is the parent of the node we are about to render.)childCount - If this node is a child of another node, the count indicates which child number it is
(used to construct the id of the next node to render.)java.io.IOExceptionprotected void encodeCurrentNode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree)
throws java.io.IOException
Renderers can extend it. That might be useful
if you would like to render additional per node information besides the tree node.context - FacesContextout - ResponseWritertree - HtmlTreejava.io.IOExceptionprotected void beforeNodeEncode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out,
HtmlTree tree)
throws java.io.IOException
java.io.IOExceptionprotected void afterNodeEncode(javax.faces.context.FacesContext context,
javax.faces.context.ResponseWriter out)
throws java.io.IOException
java.io.IOExceptionprotected boolean getBoolean(javax.faces.component.UIComponent component,
java.lang.String attributeName,
boolean defaultValue)
component - The component for which the attributes are to be checked.attributeName - The name of the boolean attribute.defaultValue - The default value of the attribute (to be returned if no value found).