oracle.adf.view.faces.component
Class UIXTree

java.lang.Object
  |
  +--javax.faces.component.UIComponent
        |
        +--oracle.adf.view.faces.component.UIXComponent
              |
              +--oracle.adf.view.faces.component.UIXComponentBase
                    |
                    +--oracle.adf.view.faces.component.CollectionBase
                          |
                          +--oracle.adf.view.faces.component.TreeBase
                                |
                                +--oracle.adf.view.faces.component.UIXTree
All Implemented Interfaces:
CollectionComponent, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
CoreTree, TreeTableBase

public class UIXTree
extends TreeBase

ADF Faces tree components are used to display hierarchical data. For example, if we have a personnel organization chart depicting all the direct reports under each employee, we could use a tree component to display this chart. While each element (employee) in the hierarchy may have any number of child elements, each element can only have one parent element.

The Tree Model

The ADF tree components use a model to access the data in the underlying hierarchy. The specific model class is oracle.adf.view.faces.model.TreeModel. You may find the oracle.adf.view.faces.model.ChildPropertyTreeModel class useful when constructing a TreeModel.

Data

The tree components use a stamping strategy similar to the ADF Table component. Child components are used to display the data for each element in the tree. Each child component is not recreated per element; instead, each child is repeatedly rendered (stamped) once per element. Because of this stamping behavior, only certain types of components are supported as children. Supported components include all components with no behavior and most components that implement the EditableValueHolder or ActionSource interfaces.

Each time a child component is stamped, the data for the current element is copied into an EL reachable property. The name of this property is defined by the var property on the tree component. Once the tree has completed rendering, this property is removed (or reverted back to its previous value).

Events

When the user expands or collapses a subtree the tree generates a DisclosureEvent. This event has an isExpanded method that returns whether the user wants to expand or collapse the subtree of a particular element. That particular element is made current on the Tree before the event is delivered.

TreeState

The ADF tree components use an instance of the oracle.adf.view.faces.model.TreeState class to keep track of which elements are expanded or collapsed. This instance is stored as the "treeState" attribute on the component. You may use this instance to programmatically control the expand/collapse state of an element in the hierarchy.

Example:


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static PropertyKey DISCLOSURE_LISTENER_KEY
           
static PropertyKey IMMEDIATE_KEY
           
static PropertyKey TREE_STATE_KEY
           
static FacesBean.Type TYPE
           
static PropertyKey VALUE_KEY
           
static PropertyKey VAR_KEY
           
 
Fields inherited from class oracle.adf.view.faces.component.UIXComponentBase
ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UIXTree()
          Construct an instance of the UIXTree.
 
Method Summary
protected  FacesBean.Type getBeanType()
           
 javax.faces.el.MethodBinding getDisclosureListener()
          Gets a method reference to a disclosure listener
 java.lang.String getFamily()
           
 TreeState getTreeState()
          Gets The expansion state for this component.
 java.lang.Object getValue()
          Gets the hierarchy of tree data - must be of type oracle.adf.view.faces.model.TreeModel
 java.lang.String getVar()
          Gets Name of the EL variable used to reference each element of the tree.
 boolean isImmediate()
          Gets whether or not data validation - client-side or server-side - should take place when events are generated by this component.
 void setDisclosureListener(javax.faces.el.MethodBinding disclosureListener)
          Sets a method reference to a disclosure listener
 void setImmediate(boolean immediate)
          Sets whether or not data validation - client-side or server-side - should take place when events are generated by this component.
 void setTreeState(TreeState treeState)
          Sets The expansion state for this component.
 void setValue(java.lang.Object value)
          Sets the hierarchy of tree data - must be of type oracle.adf.view.faces.model.TreeModel
 void setVar(java.lang.String var)
          Sets Name of the EL variable used to reference each element of the tree.
 
Methods inherited from class oracle.adf.view.faces.component.TreeBase
addDisclosureListener, encodeBegin, getDisclosureListeners, getFirst, getLocalClientId, getPath, getRowCount, getRowData, getRowIndex, getRowKey, getRows, getSelectionState, getTreeModel, isRowAvailable, isRowContainer, popPath, processDecodes, pushPath, removeDisclosureListener, restoreStampState, restoreState, saveStampState, saveState, setPath, setRowIndex, setRowKey
 
Methods inherited from class oracle.adf.view.faces.component.CollectionBase
broadcast, processUpdates, processValidators, queueEvent
 
Methods inherited from class oracle.adf.view.faces.component.UIXComponentBase
addFacesListener, createFacesBean, decode, encodeChildren, encodeEnd, findComponent, getAttribute, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getIntProperty, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, setAttribute, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final FacesBean.Type TYPE

VAR_KEY

public static final PropertyKey VAR_KEY

VALUE_KEY

public static final PropertyKey VALUE_KEY

TREE_STATE_KEY

public static final PropertyKey TREE_STATE_KEY

IMMEDIATE_KEY

public static final PropertyKey IMMEDIATE_KEY

DISCLOSURE_LISTENER_KEY

public static final PropertyKey DISCLOSURE_LISTENER_KEY

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

UIXTree

public UIXTree()
Construct an instance of the UIXTree.

Method Detail

getVar

public final java.lang.String getVar()
Gets Name of the EL variable used to reference each element of the tree. Once the tree has completed rendering, this variable is removed (or reverted back to its previous value).

Specified by:
getVar in interface CollectionComponent
Specified by:
getVar in class CollectionBase

setVar

public final void setVar(java.lang.String var)
Sets Name of the EL variable used to reference each element of the tree. Once the tree has completed rendering, this variable is removed (or reverted back to its previous value).


getValue

public final java.lang.Object getValue()
Gets the hierarchy of tree data - must be of type oracle.adf.view.faces.model.TreeModel

Specified by:
getValue in class TreeBase

setValue

public final void setValue(java.lang.Object value)
Sets the hierarchy of tree data - must be of type oracle.adf.view.faces.model.TreeModel


getTreeState

public final TreeState getTreeState()
Gets The expansion state for this component.

Specified by:
getTreeState in class TreeBase

setTreeState

public final void setTreeState(TreeState treeState)
Sets The expansion state for this component.

Specified by:
setTreeState in class TreeBase
Parameters:
treeState - the new expansion state

isImmediate

public final boolean isImmediate()
Gets whether or not data validation - client-side or server-side - should take place when events are generated by this component. When immediate is true, the default ActionListener provided by the JavaServer Faces implementation should be executed during Apply Request Values phase of the request processing lifecycle, rather than waiting until the Invoke Application phase.

Specified by:
isImmediate in class TreeBase
Returns:
whether the tree is "immediate"

setImmediate

public final void setImmediate(boolean immediate)
Sets whether or not data validation - client-side or server-side - should take place when events are generated by this component. When immediate is true, the default ActionListener provided by the JavaServer Faces implementation should be executed during Apply Request Values phase of the request processing lifecycle, rather than waiting until the Invoke Application phase.


getDisclosureListener

public final javax.faces.el.MethodBinding getDisclosureListener()
Gets a method reference to a disclosure listener

Specified by:
getDisclosureListener in class TreeBase

setDisclosureListener

public final void setDisclosureListener(javax.faces.el.MethodBinding disclosureListener)
Sets a method reference to a disclosure listener


getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class UIXComponentBase

getBeanType

protected FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXComponentBase


Copyright © 2003-2004 Oracle Corporation. All Rights Reserved.