|
||||||||||
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.TreeNode
public class TreeNode
The TreeNode component is used to insert a node in a tree structure.
Field Summary | |
---|---|
static java.lang.String |
CONTENT_FACET_KEY
This is the facet key used to define the content for the TreeNode. |
static java.lang.String |
IMAGE_FACET_KEY
This is the facet key used to set a custom image for this TreeNode . |
Fields inherited from interface javax.faces.component.NamingContainer |
---|
SEPARATOR_CHAR |
Constructor Summary | |
---|---|
TreeNode()
Constructor. |
Method Summary | |
---|---|
void |
addActionListener(javax.faces.event.ActionListener listener)
Add an action listener instance for the IconHyperlink representing this node's turner. |
void |
broadcast(javax.faces.event.FacesEvent event)
|
static Tree |
getAbsoluteRoot(javax.faces.component.UIComponent node)
This method returns the root Tree object reference. |
javax.el.MethodExpression |
getActionExpression()
The actionExpression attribute is used to specify the action to take when this component is activated by the user. |
javax.el.MethodExpression |
getActionListenerExpression()
The actionListenerExpression attribute is used to specify a method to handle an action event that is triggered when a component is activated by the user. |
javax.faces.event.ActionListener[] |
getActionListeners()
Get all ActionListener instances for this node's turner IconHyperlink click. |
TreeNode |
getChildNode(java.lang.String id)
Given the ID of a child of this node this method returns the TreeNode component corresponding to this ID. |
static TreeNode[] |
getChildTreeNodes(javax.faces.component.UIComponent node)
This method returns an array of child treeNodes only. |
Hyperlink |
getContentHyperlink()
|
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getHandleIcon(java.lang.String value)
This method enables the icon to switch from expanded to collapsed, or from collapsed to expanded depending on the current state of this component. |
java.util.List |
getImageKeys()
This method determines the theme images that should be drawn from left to right (0 to x) when rendering the lines before the text for this node. |
java.lang.String |
getImageURL()
Absolute or relative URL to the image to be rendered for the tree node. |
ImageHyperlink |
getNodeImageHyperlink()
|
static TreeNode |
getParentTreeNode(javax.faces.component.UIComponent node)
This method returns the closest parent that is a TreeNode, or null if not found. |
boolean |
getRendersChildren()
This component renders its children |
java.lang.String |
getStyle()
CSS style(s) 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. |
java.lang.String |
getText()
Specifies the text for this component. |
java.lang.String |
getToolTip()
Sets the value of the title attribute for the HTML element. |
IconHyperlink |
getTurnerImageHyperlink()
|
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 |
isVisible()
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
void |
removeActionListener(javax.faces.event.ActionListener listener)
Remove an action listener instance from the list for this node's turner IconHyperlink. |
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 |
setActionExpression(javax.el.MethodExpression actionExpression)
The actionExpression attribute is used to specify the action to take when this component is activated by the user. |
void |
setActionListenerExpression(javax.el.MethodExpression me)
The actionListenerExpression attribute is used to specify a method to handle an action event that is triggered when a component is activated by the user. |
void |
setExpanded(boolean expanded)
Set the expanded attribute to true to display the tree node as expanded when the component is initially rendered. |
void |
setId(java.lang.String id)
The component identifier for this component. |
void |
setImageURL(java.lang.String imageURL)
Absolute or relative URL to the image to be rendered for the tree node. |
void |
setRendered(boolean rendered)
Use the rendered attribute to indicate whether the HTML code for the component should be included in the rendered HTML page. |
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 |
setText(java.lang.String text)
Specifies the text for this component. |
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)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, 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 IMAGE_FACET_KEY
This is the facet key used to set a custom image for this
TreeNode
. (image)
public static final java.lang.String CONTENT_FACET_KEY
This is the facet key used to define the content for the TreeNode. (content)
Constructor Detail |
---|
public TreeNode()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class javax.faces.component.UIComponent
public void setId(java.lang.String id)
setId
in class javax.faces.component.UIComponentBase
public void setRendered(boolean rendered)
setRendered
in class javax.faces.component.UIComponentBase
public javax.el.MethodExpression getActionExpression()
The actionExpression attribute is used to specify the action to take when this component is activated by the user. The value of the action attribute must be one of the following:
(faces-config.xml)
.java.io.Serializable
interface or
javax.faces.component.StateHolder
interface.In the Tree and TreeNode components, the action applies only when attributes are used to define the tree and tree nodes. When facets are used, the action attribute does not apply to the facets.
public void setActionExpression(javax.el.MethodExpression actionExpression)
The actionExpression attribute is used to specify the action to take when this component is activated by the user. The value of the action attribute must be one of the following:
(faces-config.xml)
.java.io.Serializable
interface or
javax.faces.component.StateHolder
interface.In the Tree and TreeNode components, the action applies only when attributes are used to define the tree and tree nodes. When facets are used, the action attribute does not apply to the facets.
getActionExpression()
public javax.el.MethodExpression getActionListenerExpression()
The actionListenerExpression attribute is used to specify a method
to handle an action event that is triggered when a component is activated
by the user. The actionListenerExpression attribute value must be a
Unified EL expression that resolves to a method in a backing bean. The
method must take a single parameter that is an ActionEvent, and its
return type must be void
. The class that defines the method
must implement the java.io.Serializable
interface or
javax.faces.component.StateHolder
interface.
In the TreeNode component, the method specified by the actionListenerExpression atttribute is invoked when the node's handle icon is clicked.
public void setActionListenerExpression(javax.el.MethodExpression me)
The actionListenerExpression attribute is used to specify a method
to handle an action event that is triggered when a component is activated
by the user. The actionListenerExpression attribute value must be a
Unified EL expression that resolves to a method in a backing bean. The
method must take a single parameter that is an ActionEvent, and its
return type must be void
. The class that defines the method
must implement the java.io.Serializable
interface or
javax.faces.component.StateHolder
interface.
In the TreeNode component, the method specified by the actionListenerExpression atttribute is invoked when the node's handle icon is clicked.
getActionListenerExpression()
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 getStyle()
CSS style(s) to be applied to the outermost HTML element when this component is rendered.
public void setStyle(java.lang.String style)
CSS style(s) to be applied to the outermost HTML element when this component is rendered.
getStyle()
public java.lang.String getStyleClass()
CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
getStyleClass()
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 getText()
Specifies the text for this component. 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. The text attribute does not apply when the content facet is used.
public void setText(java.lang.String text)
Specifies the text for this component. 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. The text attribute does not apply when the content facet is used.
getText()
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 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 boolean isVisible()
Use the visible attribute to indicate whether the component 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, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
public void setVisible(boolean visible)
Use the visible attribute to indicate whether the component 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, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
isVisible()
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 boolean getRendersChildren()
getRendersChildren
in class javax.faces.component.UIComponentBase
public java.util.List getImageKeys()
This method determines the theme images that should be drawn from left to right (0 to x) when rendering the lines before the text for this node.
List
of Strings that represent theme keys for
the images to be drawn. The first list element is the first
image to display when rendering left to right.public TreeNode getChildNode(java.lang.String id)
id
- The id of the child node being searched for.
public static TreeNode getParentTreeNode(javax.faces.component.UIComponent node)
This method returns the closest parent that is a TreeNode, or null if not found.
node
- The starting TreeNode
.
TreeNode
public static Tree getAbsoluteRoot(javax.faces.component.UIComponent node)
This method returns the root Tree object reference. This method is required to find out this is a client side tree and if nodes should expand on selection of the anything other than the handler images. The "clientSide" and "expandOnSelect" attributes of the Tree component are used to supply this information.
Tree
component.public static TreeNode[] getChildTreeNodes(javax.faces.component.UIComponent node)
This method returns an array of child treeNodes only.
node
- The starting TreeNode
.
TreeNode
public void addActionListener(javax.faces.event.ActionListener listener)
Add an action listener instance for the IconHyperlink representing this node's turner.
listener
- The ActionListener instance to register for turner
IconHyperlink clicks.public javax.faces.event.ActionListener[] getActionListeners()
Get all ActionListener instances for this node's turner IconHyperlink click.
public void removeActionListener(javax.faces.event.ActionListener listener)
Remove an action listener instance from the list for this node's turner IconHyperlink.
listener
- The ActionListener instance to remove.public java.lang.String getHandleIcon(java.lang.String value)
This method enables the icon to switch from expanded to collapsed, or from collapsed to expanded depending on the current state of this component.
value
- The current value of the Icon. It will use the current
value to re-use first/last information from the old key.
public Hyperlink getContentHyperlink()
public ImageHyperlink getNodeImageHyperlink()
public IconHyperlink getTurnerImageHyperlink()
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.component.UIComponentBase
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
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 |