|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase org.apache.myfaces.custom.tree2.UITreeData
public class 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 String |
COMPONENT_FAMILY
|
static 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 |
collapseAll()
Collapse all nodes by default. |
void |
collapsePath(String[] nodePath)
Expands all of the nodes in the specfied path. |
void |
encodeBegin(javax.faces.context.FacesContext context)
|
void |
encodeEnd(javax.faces.context.FacesContext context)
|
void |
expandAll()
Epands all nodes by default. |
void |
expandPath(String[] nodePath)
Expands all of the nodes in the specfied path. |
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. |
String |
getFamily()
|
Object |
getModel()
Gets the model of the TreeData - due to backwards-compatibility, this can also be retrieved by getValue. |
TreeNode |
getNode()
Calls through to the TreeModel and returns the current TreeNode or null . |
String |
getNodeId()
|
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. |
Object |
getValue()
Deprecated. |
String |
getVar()
Return the request-scope attribute under which the data object for the current node will be exposed when iterating. |
boolean |
isLastChild(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. |
boolean |
isNodeSelected()
Indicates whether or not the current TreeNode is selected. |
void |
processDecodes(javax.faces.context.FacesContext context)
|
protected void |
processNodes(javax.faces.context.FacesContext context,
int processAction,
TreeWalker walker)
|
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,
Object state)
|
Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setModel(Object model)
Sets the model of the TreeData - due to backwards-compatibility, this can also be set by calling setValue. |
void |
setNodeId(String nodeId)
|
void |
setNodeSelected(javax.faces.event.ActionEvent event)
Implements the ActionListener interface. |
void |
setValue(Object value)
Deprecated. |
void |
setValueBinding(String name,
javax.faces.el.ValueBinding binding)
|
void |
setVar(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, 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 String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
Constructor Detail |
---|
public UITreeData()
Method Detail |
---|
public String getFamily()
getFamily
in class javax.faces.component.UIComponent
public Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UIComponentBase
public void restoreState(javax.faces.context.FacesContext context, Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIComponentBase
public void encodeEnd(javax.faces.context.FacesContext context) throws IOException
encodeEnd
in class javax.faces.component.UIComponentBase
IOException
public void queueEvent(javax.faces.event.FacesEvent event)
queueEvent
in class javax.faces.component.UIComponentBase
public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
broadcast
in class javax.faces.component.UIComponentBase
javax.faces.event.AbortProcessingException
public void processDecodes(javax.faces.context.FacesContext context)
processDecodes
in class javax.faces.component.UIComponentBase
public void processValidators(javax.faces.context.FacesContext context)
processValidators
in class javax.faces.component.UIComponentBase
public void processUpdates(javax.faces.context.FacesContext context)
processUpdates
in class javax.faces.component.UIComponentBase
public String getClientId(javax.faces.context.FacesContext context)
getClientId
in class javax.faces.component.UIComponentBase
public void setValueBinding(String name, javax.faces.el.ValueBinding binding)
setValueBinding
in class javax.faces.component.UIComponentBase
public void encodeBegin(javax.faces.context.FacesContext context) throws IOException
encodeBegin
in class javax.faces.component.UIComponentBase
IOException
public void setValue(Object value)
value
- The new valuepublic Object getModel()
getModel
in interface Tree
public void setModel(Object model)
setModel
in interface Tree
model
- The new modelpublic Object getValue()
public void setVar(String var)
setVar
in interface Tree
var
- The new request-scope attribute namepublic String getVar()
getVar
in interface Tree
public TreeNode getNode()
TreeModel
and returns the current TreeNode
or null
.
getNode
in interface Tree
public String getNodeId()
getNodeId
in interface Tree
public void setNodeId(String nodeId)
setNodeId
in interface Tree
public String[] getPathInformation(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.
getPathInformation
in interface Tree
nodeId
- The id of the node for whom the path information is needed.
public boolean isLastChild(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
.
isLastChild
in interface Tree
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.
getDataModel
in interface Tree
public void expandAll()
expandAll
in interface Tree
public void collapseAll()
collapseAll
in interface Tree
public void expandPath(String[] nodePath)
expandPath
in interface Tree
nodePath
- The path to expand.public void collapsePath(String[] nodePath)
collapsePath
in interface Tree
nodePath
- The path to expand.protected void processNodes(javax.faces.context.FacesContext context, int processAction, TreeWalker walker)
public void toggleExpanded()
toggleExpanded
in interface Tree
public boolean isNodeExpanded()
TreeNode
is expanded.
isNodeExpanded
in interface Tree
public void setNodeSelected(javax.faces.event.ActionEvent event)
ActionListener
interface. Basically, this
method is used to listen for node selection events (when a user has clicked on a
leaf node.)
setNodeSelected
in interface Tree
event
- ActionEventpublic boolean isNodeSelected()
TreeNode
is selected.
isNodeSelected
in interface Tree
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |