|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
org.apache.myfaces.custom.tree2.UITreeData
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. Renderer
s of this
component should use the appropriate facet to assist in rendering.
Field Summary | |
---|---|
static java.lang.String |
COMPONENT_FAMILY
|
static java.lang.String |
COMPONENT_TYPE
|
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
UITreeData()
Constructor |
Method Summary | |
---|---|
void |
broadcast(javax.faces.event.FacesEvent event)
|
void |
collapsePath(java.lang.String[] nodePath)
Expands all of the nodes in the specfied path. |
void |
encodeBegin(javax.faces.context.FacesContext context)
|
void |
expandAll()
Epands all nodes by default. |
void |
expandPath(java.lang.String[] nodePath)
Expands all of the nodes in the specfied path. |
java.lang.String |
getClientId(javax.faces.context.FacesContext context)
|
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. |
java.lang.String |
getFamily()
|
TreeNode |
getNode()
Calls through to the TreeModel and returns the current TreeNode or null . |
java.lang.String |
getNodeId()
|
java.lang.String[] |
getPathInformation(java.lang.String nodeId)
Gets an array of String containing the ID's of all of the TreeNode s in the path to
the specified node. |
java.lang.Object |
getValue()
Gets the value of the TreeData. |
java.lang.String |
getVar()
Return the request-scope attribute under which the data object for the current node will be exposed when iterating. |
boolean |
isLastChild(java.lang.String nodeId)
Indicates whether or not the specified TreeNode is the last child in the List
of children. |
boolean |
isNodeExpanded()
Indicates whether or not the current TreeNode is expanded. |
protected void |
processChildNodes(javax.faces.context.FacesContext context,
TreeNode parentNode,
int processAction)
Process the child nodes of the supplied parent TreeNode . |
void |
processDecodes(javax.faces.context.FacesContext context)
|
void |
processUpdates(javax.faces.context.FacesContext context)
|
void |
processValidators(javax.faces.context.FacesContext context)
|
void |
queueEvent(javax.faces.event.FacesEvent event)
|
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 |
setValue(java.lang.Object value)
Sets the value of the TreeData. |
void |
setValueBinding(java.lang.String name,
javax.faces.el.ValueBinding binding)
|
void |
setVar(java.lang.String var)
Set the request-scope attribute under which the data object for the current node wil be exposed when iterating. |
void |
toggleExpanded()
Toggle the expanded state of the current node. |
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 |
public static final java.lang.String COMPONENT_TYPE
public static final java.lang.String COMPONENT_FAMILY
Constructor Detail |
public UITreeData()
Method Detail |
public java.lang.String getFamily()
public java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
public void queueEvent(javax.faces.event.FacesEvent event)
public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
javax.faces.event.AbortProcessingException
public void processDecodes(javax.faces.context.FacesContext context)
public void processValidators(javax.faces.context.FacesContext context)
public void processUpdates(javax.faces.context.FacesContext context)
public java.lang.String getClientId(javax.faces.context.FacesContext context)
public void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
public void encodeBegin(javax.faces.context.FacesContext context) throws java.io.IOException
java.io.IOException
public void setValue(java.lang.Object value)
value
- The new valuepublic java.lang.Object getValue()
public void setVar(java.lang.String var)
var
- The new request-scope attribute namepublic java.lang.String getVar()
public TreeNode getNode()
TreeModel
and returns the current TreeNode
or null
.
public java.lang.String getNodeId()
public void setNodeId(java.lang.String nodeId)
public java.lang.String[] getPathInformation(java.lang.String nodeId)
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.
public boolean isLastChild(java.lang.String nodeId)
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
public TreeModel getDataModel()
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.
public void expandAll()
public void expandPath(java.lang.String[] nodePath)
nodePath
- The path to expand.public void collapsePath(java.lang.String[] nodePath)
nodePath
- The path to expand.protected void processChildNodes(javax.faces.context.FacesContext context, TreeNode parentNode, int processAction)
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 processpublic void toggleExpanded()
public boolean isNodeExpanded()
TreeNode
is expanded.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |