org.apache.myfaces.custom.tree2
Class AbstractHtmlTree

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.tree2.UITreeData
              extended by org.apache.myfaces.custom.tree2.AbstractHtmlTree
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder, LocationAware, Tree
Direct Known Subclasses:
HtmlTree

public abstract class AbstractHtmlTree
extends UITreeData
implements LocationAware

Represents "tree data" in an HTML format. Also provides a mechanism for maintaining expand/collapse state of the nodes in the tree. A component that provides an HTML-based tree from data supplied by a backing bean. The tree is highly customizable and allows for fine-grained control over the appearance of each of the nodes depending on their type. Almost any type of JSF component (text, image, checkbox, etc.) can be rendered inside the nodes and there is an option for client-side or server-side toggling of the expand/collapse state. Unless otherwise specified, all attributes accept static values or EL expressions.

Since:
1.1.7
Author:
Sean Schofield

Field Summary
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class org.apache.myfaces.custom.tree2.UITreeData
COMPONENT_FAMILY
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
AbstractHtmlTree()
           
 
Method Summary
 javax.faces.component.UICommand getExpandControl()
          Gets the expand/collapse control that can be used to handle expand/collapse nodes.
 java.lang.String getVarNodeToggler()
          Gets
 boolean isClientSideToggle()
          Perform client-side toggling of expand/collapse state via javascript (default is true.)
abstract  boolean isPreserveToggle()
          Preserve changes in client-side toggle information between requests (default is true.)
abstract  boolean isShowLines()
          Show the connecting lines (default is true.)
abstract  boolean isShowNav()
          Show the "plus" and "minus" navigation icons (default is true.) Value is ignored if clientSideToggle is true.
abstract  boolean isShowRootNode()
          Include the root node when rendering the tree (default is true.)
protected  void processNodes(javax.faces.context.FacesContext context, int processAction, TreeWalker walker)
           
 void restoreState(javax.faces.context.FacesContext facesContext, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setClientSideToggle(boolean clientSideToggle)
          Sets
 void setNodeId(java.lang.String nodeId)
           
 void setVarNodeToggler(java.lang.String varNodeToggler)
           
 
Methods inherited from class org.apache.myfaces.custom.tree2.UITreeData
broadcast, collapseAll, collapsePath, encodeBegin, encodeEnd, expandAll, expandPath, getClientId, getDataModel, getFamily, getModel, getNode, getNodeId, getPathInformation, getValue, getVar, isLastChild, isNodeExpanded, isNodeSelected, processDecodes, processUpdates, processValidators, queueEvent, setModel, setNodeSelected, setValue, setValueBinding, setVar, toggleExpanded
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.myfaces.component.LocationAware
getImageLocation, getJavascriptLocation, getStyleLocation
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractHtmlTree

public AbstractHtmlTree()
Method Detail

isClientSideToggle

public boolean isClientSideToggle()
Perform client-side toggling of expand/collapse state via javascript (default is true.)

Returns:
the new clientSideToggle value

setClientSideToggle

public void setClientSideToggle(boolean clientSideToggle)
Sets

Parameters:
clientSideToggle - the new clientSideToggle value

processNodes

protected void processNodes(javax.faces.context.FacesContext context,
                            int processAction,
                            TreeWalker walker)
Overrides:
processNodes in class UITreeData
See Also:
UITreeData.processNodes(javax.faces.context.FacesContext, int, org.apache.myfaces.custom.tree2.TreeWalker)

setNodeId

public void setNodeId(java.lang.String nodeId)
Specified by:
setNodeId in interface Tree
Overrides:
setNodeId in class UITreeData

getExpandControl

public javax.faces.component.UICommand getExpandControl()
Gets the expand/collapse control that can be used to handle expand/collapse nodes. This is only used in server-side mode. It allows the nagivation controls (if any) to be clickable as well as any commandLinks the user has set up in their JSP.

Returns:
UICommand

getVarNodeToggler

public java.lang.String getVarNodeToggler()
Gets

Returns:
the new varNodeToggler value

setVarNodeToggler

public void setVarNodeToggler(java.lang.String varNodeToggler)

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class UITreeData

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class UITreeData

isShowNav

public abstract boolean isShowNav()
Show the "plus" and "minus" navigation icons (default is true.) Value is ignored if clientSideToggle is true.


isShowLines

public abstract boolean isShowLines()
Show the connecting lines (default is true.)


isShowRootNode

public abstract boolean isShowRootNode()
Include the root node when rendering the tree (default is true.)


isPreserveToggle

public abstract boolean isPreserveToggle()
Preserve changes in client-side toggle information between requests (default is true.)



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.