com.sun.webui.jsf.component
Class Tree2

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.WebuiComponent
              extended by com.sun.webui.jsf.component.TreeNode2
                  extended by com.sun.webui.jsf.component.Tree2
All Implemented Interfaces:
javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class Tree2
extends TreeNode2
implements javax.faces.component.NamingContainer

The Tree2 component is used to display a tree structure in the rendered HTML page.


Field Summary
 
Fields inherited from class com.sun.webui.jsf.component.TreeNode2
NODE_IMAGE_FACET_NAME, NODE_LABEL_FACET_NAME
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Tree2()
          Create a new instance of the Tree2.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by this component.
 java.lang.String getRendererType()
          Return the renderer type associated with this component.
static Tree2 getRoot(javax.faces.component.UIComponent node)
          Return the root of the tree for a given node.
 java.lang.String[] getSelectedNodeIds()
          Return an array of selected node IDs.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 boolean isLoadOnExpand()
          Returns true if the node's children should be loaded on select, false otherwise.
 boolean isMultipleSelect()
          Returns true if multiple nodes can be selected, false otherwise.
 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 setHtmlTemplate(java.lang.String htmlTemplate)
          Set alternative HTML template to be used by this component.
 void setLoadOnExpand(boolean loadOnExpand)
          Set to true if nodes should be loaded when selected.
 void setMultipleSelect(boolean multipleSelect)
          Set to true if multiple node can be selected.
 void setSelectedNodeIds(java.lang.String[] selectedNodeIds)
          Set the array of selected nodes.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void yokeNode(java.lang.String nodeId)
          Yoke to a given node.
 
Methods inherited from class com.sun.webui.jsf.component.TreeNode2
broadcast, findChildNode, findChildNode, getImageURL, getLabel, getNodeSelectedActionListenerExpression, getPath, getPathComponent, getPathCount, getStyle, getStyleClass, getTarget, getToggleActionListenerExpression, getToolTip, getUrl, isExpanded, isImmediate, isLeaf, isSelected, isVisible, queueEvent, setExpanded, setImageURL, setImmediate, setLabel, setNodeSelectedActionListenerExpression, setSelected, setStyle, setStyleClass, setTarget, setToggleActionListenerExpression, setToolTip, setUrl, setVisible
 
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
 

Constructor Detail

Tree2

public Tree2()
Create a new instance of the Tree2.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class TreeNode2

getRendererType

public java.lang.String getRendererType()

Return the renderer type associated with this component.

Overrides:
getRendererType in class TreeNode2

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getHtmlTemplate

public java.lang.String getHtmlTemplate()
Get alternative HTML template to be used by this component.


setHtmlTemplate

public void setHtmlTemplate(java.lang.String htmlTemplate)
Set alternative HTML template to be used by this component.


isLoadOnExpand

public boolean isLoadOnExpand()
Returns true if the node's children should be loaded on select, false otherwise. This value is false by default.


setLoadOnExpand

public void setLoadOnExpand(boolean loadOnExpand)
Set to true if nodes should be loaded when selected.


isMultipleSelect

public boolean isMultipleSelect()
Returns true if multiple nodes can be selected, false otherwise. This value is false by default.


setMultipleSelect

public void setMultipleSelect(boolean multipleSelect)
Set to true if multiple node can be selected.


getSelectedNodeIds

public java.lang.String[] getSelectedNodeIds()
Return an array of selected node IDs. If no nodes are selected an empty array is returned.


setSelectedNodeIds

public void setSelectedNodeIds(java.lang.String[] selectedNodeIds)
Set the array of selected nodes.


yokeNode

public void yokeNode(java.lang.String nodeId)
Yoke to a given node. Expand all the nodes that fall on the path from this node to the root.

Parameters:
nodeID - The ID of the node that is to be yoked.

getRoot

public static Tree2 getRoot(javax.faces.component.UIComponent node)
Return the root of the tree for a given node.

Parameters:
node - The node whose root is to be found
Returns:
The Tree2 object representing the root node.

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)
Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class TreeNode2

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class TreeNode2


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.