|
||||||||||
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
com.sun.webui.jsf.component.WebuiComponent
com.sun.webui.jsf.component.TreeNode2
public class TreeNode2
An Ajax based tree node component. This component could either be a leaf node or
a non leaf node in which case it can have one or more children. Nodes
can be selected by setting the
selected
property to true, which may be bound to a model value. Action
listeners may be registered individually each node to indicate node selection.
Action listeners may also be regsitered to indicate a node toggle. This would
be one way of loading child nodes when the user clicks on a node's toggle
icon. Note that for this to work, the Tree2 components of which this node is a
child should have the "loadOnExpand" property set to "true".
Field Summary | |
---|---|
static java.lang.String |
NODE_IMAGE_FACET_NAME
|
static java.lang.String |
NODE_LABEL_FACET_NAME
|
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
TreeNode2()
Create a new instance of the TreeNode2. |
Method Summary | |
---|---|
void |
broadcast(javax.faces.event.FacesEvent event)
If a TreeNode2 component's toggleNode was clicked or the node was selected and the application had chosen to handle these events then these events need to be broadcast. |
static TreeNode2 |
findChildNode(javax.faces.context.FacesContext context,
TreeNode2 node,
java.lang.String clientId)
Given the client ID of the node and the root of the sub tree where it exists this method returns the TreeNode2 object representing the node. |
static TreeNode2 |
findChildNode(TreeNode2 node,
java.lang.String nodeId)
Given the ID of the node and the root of the sub tree where it exists this method returns the TreeNode2 object representing the node. |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getImageURL()
Absolute or relative URL to the image to be rendered for the tree node. |
java.lang.String |
getLabel()
Get the label for this node. |
javax.el.MethodExpression |
getNodeSelectedActionListenerExpression()
The nodeSelectedActionListenerExpression attribute is used to specify a method to handle the tree node selection event which is triggered when a node is selected by the user. |
TreeNode2[] |
getPath()
|
java.lang.Object |
getPathComponent(int index)
Returns the path component at the specified index. |
int |
getPathCount()
Returns the number of elements in the path. |
java.lang.String |
getRendererType()
Return the renderer type associated with this component. |
java.lang.String |
getStyle()
CSS style or styles to be applied to the outermost HTML element when this component is rendered. |
java.lang.String |
getStyleClass()
CSS style class(es) to be applied to the outermost HTML element when this component is rendered. |
java.lang.String |
getTarget()
The resource at the specified URL is displayed in the frame that is specified with the target attribute. |
javax.el.MethodExpression |
getToggleActionListenerExpression()
The toggleActionListenerExpression attribute is used to specify a method to handle the tree node toggle event which is triggered when toggle node is clicked by the user. |
java.lang.String |
getToolTip()
Sets the value of the title attribute for the HTML element. |
java.lang.String |
getUrl()
Indicates that the text that is specified with the text attribute should be rendered as a hyperlink that resolves to the specified URL. |
boolean |
isExpanded()
Set the expanded attribute to true to display the tree node as expanded when the component is initially rendered. |
boolean |
isImmediate()
Return a flag indicating that this event should be broadcast at the next available opportunity, ususally between lifecycle phases i.e. |
boolean |
isLeaf()
Returns true if the node is a leaf. |
boolean |
isSelected()
Returns true if the node is selected. |
boolean |
isVisible()
Indicates whether the node should be viewable by the user in the rendered HTML page. |
void |
queueEvent(javax.faces.event.FacesEvent e)
If Tree2 is marked as immediate then schedule any tree related events in the earliest possible phase of the JSF lifecycle. |
void |
restoreState(javax.faces.context.FacesContext _context,
java.lang.Object _state)
Restore the state of this component. |
java.lang.Object |
saveState(javax.faces.context.FacesContext _context)
Save the state of this component. |
void |
setExpanded(boolean expanded)
Set the expanded attribute to true to display the tree node as expanded when the component is initially rendered. |
void |
setImageURL(java.lang.String imageURL)
Absolute or relative URL to the image to be rendered for the tree node. |
void |
setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent . |
void |
setLabel(java.lang.String label)
Set the label for this node. |
void |
setNodeSelectedActionListenerExpression(javax.el.MethodExpression me)
The nodeSelectedActionListenerExpression attribute is used to specify a method to handle the tree node selection event which is triggered when a node is selected by the user. |
void |
setSelected(boolean selected)
Set to true if this node should be selected. |
void |
setStyle(java.lang.String style)
CSS style(s) to be applied to the outermost HTML element when this component is rendered. |
void |
setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element when this component is rendered. |
void |
setTarget(java.lang.String target)
The resource at the specified URL is displayed in the frame that is specified with the target attribute. |
void |
setToggleActionListenerExpression(javax.el.MethodExpression me)
The toggleActionListenerExpression attribute is used to specify a method to handle the tree node toggle event which is triggered when toggle node is clicked by the user. |
void |
setToolTip(java.lang.String toolTip)
Sets the value of the title attribute for the HTML element. |
void |
setUrl(java.lang.String url)
Indicates that the text that is specified with the text attribute should be rendered as a hyperlink that resolves to the specified URL. |
void |
setVisible(boolean visible)
Set the visible attribute. |
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent |
---|
processDecodes, processUpdates, processValidators, setId, setRendered |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression |
Methods inherited from class javax.faces.component.UIComponent |
---|
encodeAll, getContainerClientId |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NODE_LABEL_FACET_NAME
public static final java.lang.String NODE_IMAGE_FACET_NAME
Constructor Detail |
---|
public TreeNode2()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class javax.faces.component.UIComponent
public java.lang.String getRendererType()
Return the renderer type associated with this component.
getRendererType
in class javax.faces.component.UIComponentBase
public void queueEvent(javax.faces.event.FacesEvent e)
queueEvent
in class javax.faces.component.UIComponentBase
e
- The Event to be queued.public void broadcast(javax.faces.event.FacesEvent event) throws javax.faces.event.AbortProcessingException
broadcast
in class javax.faces.component.UIComponentBase
event
- The FacesEvent being broadcast.
javax.faces.event.AbortProcessingException
public boolean isImmediate()
PhaseId.ANY
.
public void setImmediate(boolean immediate)
Set the "immediate execution" flag for this UIComponent
.
immediate
- The new immediate execution flagpublic javax.el.MethodExpression getToggleActionListenerExpression()
The toggleActionListenerExpression attribute is used to specify a method to handle the tree node toggle event which is triggered when toggle node is clicked by the user. The toggleActionListenerExpression attribute value must be a Unified EL expression that resolves to a method in a backing bean.
public void setToggleActionListenerExpression(javax.el.MethodExpression me)
The toggleActionListenerExpression attribute is used to specify a method to handle the tree node toggle event which is triggered when toggle node is clicked by the user. The toggleActionListenerExpression attribute value must be a Unified EL expression that resolves to a method in a backing bean.
getToggleActionListenerExpression()
public javax.el.MethodExpression getNodeSelectedActionListenerExpression()
The nodeSelectedActionListenerExpression attribute is used to specify a method to handle the tree node selection event which is triggered when a node is selected by the user. The nodeSelectedActionListenerExpression attribute value must be a Unified EL expression that resolves to a method in a backing bean.
public void setNodeSelectedActionListenerExpression(javax.el.MethodExpression me)
The nodeSelectedActionListenerExpression attribute is used to specify a method to handle the tree node selection event which is triggered when a node is selected by the user. The nodeSelectedActionListenerExpression attribute value must be a Unified EL expression that resolves to a method in a backing bean.
getNodeSelectedActionListenerExpression()
public java.lang.String getStyle()
public void setStyle(java.lang.String style)
getStyle()
public java.lang.String getStyleClass()
public void setStyleClass(java.lang.String styleClass)
getStyleClass()
public boolean isVisible()
Indicates whether the node should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, this setting is true, so HTML for the component is included and visible to the user. If the accordion component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
public void setVisible(boolean visible)
Set the visible attribute.
isVisible()
public boolean isSelected()
public void setSelected(boolean selected)
public boolean isExpanded()
Set the expanded attribute to true to display the tree node as expanded when the component is initially rendered. When a node is expanded, its child tree nodes are displayed. By default, nodes are collapsed initially.
public void setExpanded(boolean expanded)
Set the expanded attribute to true to display the tree node as expanded when the component is initially rendered. When a node is expanded, its child tree nodes are displayed. By default, nodes are collapsed initially.
isExpanded()
public java.lang.String getImageURL()
Absolute or relative URL to the image to be rendered for the tree node.
Note that you cannot use the imageURL to display a theme image in the
tree. You should use an image facet that contains a webuijsf:image or webuijsf:imageHyperlink
tag to use a theme image. The imageURL attribute is overridden by the image
facet.
When the imageURL attribute is used with the url attribute, the image is hyperlinked.
public void setImageURL(java.lang.String imageURL)
Absolute or relative URL to the image to be rendered for the tree node.
Note that you cannot use the imageURL to display a theme image in the
tree. You should use an image facet that contains a webuijsf:image or webuijsf:imageHyperlink
tag to use a theme image. The imageURL attribute is overridden by the image
facet.
When the imageURL attribute is used with the url attribute, the image is hyperlinked.
getImageURL()
public java.lang.String getUrl()
Indicates that the text that is specified with the text attribute should be rendered as a hyperlink that resolves to the specified URL. If the imageURL attribute is used with the url attribute, the image is hyperlinked. The url attribute does not apply to facets.
public void setUrl(java.lang.String url)
Indicates that the text that is specified with the text attribute should be rendered as a hyperlink that resolves to the specified URL. If the imageURL attribute is used with the url attribute, the image is hyperlinked. The url attribute does not apply to facets.
getUrl()
public java.lang.String getTarget()
The resource at the specified URL is displayed in the frame that is specified with the target attribute. Values such as "_blank" that are valid for the target attribute of the <a> HTML element are also valid for this attribute in the tree components. The target attribute is useful only with the url attribute, and does not apply when a facet is used.
public void setTarget(java.lang.String target)
The resource at the specified URL is displayed in the frame that is specified with the target attribute. Values such as "_blank" that are valid for the target attribute of the <a> HTML element are also valid for this attribute in the tree components. The target attribute is useful only with the url attribute, and does not apply when a facet is used.
getTarget()
public java.lang.String getLabel()
Get the label for this node. If the url or action attributes are also specified, the text is rendered as a hyperlink. If neither the url or action attributes are specified, the specified text is rendered as static text. Users can click on the text to select the node. The nodeLabel attribute does not apply when the nodeLabel facet is used.
public void setLabel(java.lang.String label)
Set the label for this node. If the url or action attributes are also specified, the text is rendered as a hyperlink. If neither the url or action attributes are specified, the specified text is rendered as static text. Users can click on the text to select the node. The nodeLabel attribute does not apply when the nodeLabel facet is used.
#getNodeLabel()
public java.lang.String getToolTip()
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.
public void setToolTip(java.lang.String toolTip)
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.
getToolTip()
public static TreeNode2 findChildNode(TreeNode2 node, java.lang.String nodeId)
context
- The FacesContextnode
- The node representing the root of the subtree where the
child node should be searched for.nodeID
- The ID of the child node.
public static TreeNode2 findChildNode(javax.faces.context.FacesContext context, TreeNode2 node, java.lang.String clientId)
context
- The FacesContextnode
- The node representing the root of the subtree where the
child node should be searched for.clientId
- The clientID of the child node.
public boolean isLeaf()
public TreeNode2[] getPath()
public int getPathCount()
public java.lang.Object getPathComponent(int index)
index
- an int specifying an index in the path, where
0 is the first element in the path
java.lang.IllegalArgumentException
- if the index is beyond the length
of the pathpublic void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIComponentBase
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.component.UIComponentBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |