TreeData is a
UIComponent
that supports binding data stored in a tree represented
by a
TreeNode
instance. During iterative processing over the tree nodes in the
data model, the object for the current node is exposed as a request attribute under the key
specified by the
var
property.
javax.faces.render.Renderer
s of this
component should use the appropriate facet to assist in rendering.
broadcast
public void broadcast(FacesEvent event)
throws AbortProcessingException
collapsePath
public void collapsePath(String[] nodePath)
Expands all of the nodes in the specfied path.
nodePath
- The path to expand.
encodeBegin
public void encodeBegin(FacesContext context)
throws IOException
expandAll
public void expandAll()
Epands all nodes by default.
expandPath
public void expandPath(String[] nodePath)
Expands all of the nodes in the specfied path.
nodePath
- The path to expand.
getClientId
public String getClientId(FacesContext context)
getDataModel
public TreeModel getDataModel()
Returns a previously cached
TreeModel
, if any, or sets the cache variable to either the
current value (if its a
TreeModel
) or to a new instance of
TreeModel
(if it's a
TreeNode
) with the provided value object as the root node.
getFamily
public String getFamily()
getNodeId
public String getNodeId()
getPathInformation
public String[] getPathInformation(String nodeId)
Gets an array of String containing the ID's of all of the
TreeNode
s in the path to
the specified node. The path information will be an array of
String
objects
representing node ID's. The array will starting with the ID of the root node and end with
the ID of the specified node.
nodeId
- The id of the node for whom the path information is needed.
getValue
public Object getValue()
Gets the value of the TreeData.
getVar
public String getVar()
Return the request-scope attribute under which the data object for the current node will be exposed
when iterating. This property is not enabled for value binding expressions.
isLastChild
public boolean isLastChild(String nodeId)
Indicates whether or not the specified
TreeNode
is the last child in the
List
of children. If the node id provided corresponds to the root node, this returns
true
.
nodeId
- The ID of the node to check
isNodeExpanded
public boolean isNodeExpanded()
Indicates whether or not the current
TreeNode
is expanded.
processChildNodes
protected void processChildNodes(FacesContext context,
TreeNode parentNode,
int processAction)
Process the child nodes of the supplied parent
TreeNode
. This method is protected so that
it can be overriden by a subclass that may want to control how child nodes are processed.
context
- FacesContextparentNode
- The parent node whose children are to be processedprocessAction
- An int
representing the type of action to process
processDecodes
public void processDecodes(FacesContext context)
processUpdates
public void processUpdates(FacesContext context)
processValidators
public void processValidators(FacesContext context)
queueEvent
public void queueEvent(FacesEvent event)
restoreState
public void restoreState(FacesContext context,
Object state)
saveState
public Object saveState(FacesContext context)
setNodeId
public void setNodeId(String nodeId)
setValue
public void setValue(Object value)
Sets the value of the TreeData.
setValueBinding
public void setValueBinding(String name,
ValueBinding binding)
setVar
public void setVar(String var)
Set the request-scope attribute under which the data object for the current node wil be exposed
when iterating.
var
- The new request-scope attribute name
toggleExpanded
public void toggleExpanded()
Toggle the expanded state of the current node.