org.apache.myfaces.custom.tree2
Class HtmlTree

java.lang.Object
  |
  +--javax.faces.component.UIComponent
        |
        +--javax.faces.component.UIComponentBase
              |
              +--org.apache.myfaces.custom.tree2.UITreeData
                    |
                    +--org.apache.myfaces.custom.tree2.HtmlTree
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class HtmlTree
extends UITreeData

Represents "tree data" in an HTML format. Also provides a mechanism for maintaining expand/collapse state of the nodes in the tree.

Version:
$Revision: 1.9 $ $Date: 2005/03/16 19:32:01 $
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 interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
HtmlTree()
          Constructor
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context)
           
 javax.faces.component.UICommand getExpandControl()
          Gets the expand/collapse control that can be used to handle expand/collapse nodes.
 boolean isNodeExpanded()
          Indicates whether or not the current TreeNode is expanded.
 boolean isNodeSelected()
          Indicates whether or not the current TreeNode is selected.
protected  void processChildNodes(javax.faces.context.FacesContext context, TreeNode parentNode, int processAction)
          Process the child nodes of the supplied parent @{link TreeNode}.
 void processDecodes(javax.faces.context.FacesContext context)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setNodeId(java.lang.String nodeId)
           
 void setNodeSelected(javax.faces.event.ActionEvent event)
          Implements the ActionListener interface.
 void setVarNodeToggler(java.lang.String varNodeToggler)
           
 java.lang.String toggleExpanded()
           
 
Methods inherited from class org.apache.myfaces.custom.tree2.UITreeData
broadcast, getClientId, getFamily, getNode, getNodeId, getPathInformation, getValue, getVar, isLastChild, processUpdates, processValidators, queueEvent, setValue, setValueBinding, setVar
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

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

HtmlTree

public HtmlTree()
Constructor

Method Detail

saveState

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

restoreState

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

setNodeId

public void setNodeId(java.lang.String nodeId)
Overrides:
setNodeId in class UITreeData

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Overrides:
processDecodes in class UITreeData

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class UITreeData
java.io.IOException

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

setVarNodeToggler

public void setVarNodeToggler(java.lang.String varNodeToggler)

toggleExpanded

public java.lang.String toggleExpanded()

isNodeExpanded

public boolean isNodeExpanded()
Indicates whether or not the current TreeNode is expanded.

Returns:
boolean

processChildNodes

protected void processChildNodes(javax.faces.context.FacesContext context,
                                 TreeNode parentNode,
                                 int processAction)
Description copied from class: UITreeData
Process the child nodes of the supplied parent @{link TreeNode}. This method is protected so that it can be overriden by a subclass that may want to control how child nodes are processed.

Overrides:
processChildNodes in class UITreeData
Parameters:
context - FacesContext
parentNode - The parent node whose children are to be processed
processAction - An int representing the type of action to process

setNodeSelected

public void setNodeSelected(javax.faces.event.ActionEvent event)
Implements the ActionListener interface. Basically, this method is used to listen for node selection events (when a user has clicked on a leaf node.)

Parameters:
event - ActionEvent

isNodeSelected

public boolean isNodeSelected()
Indicates whether or not the current TreeNode is selected.

Returns:
boolean