oracle.adf.view.faces.component
Class TreeBase

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
All Implemented Interfaces:
CollectionComponent, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
UIXTree

public abstract class TreeBase
extends CollectionBase
implements javax.faces.component.NamingContainer, CollectionComponent

Base class for the Tree component. The behaviour supported by this class includes expanding and collapsing tree elements.


Field Summary
 
Fields inherited from class oracle.adf.view.faces.component.UIXComponentBase
ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY, TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
  TreeBase()
          Create a Tree component with the default render-type
protected TreeBase(java.lang.String rendererType)
          Create a Tree component with the given render-type
 
Method Summary
 void addDisclosureListener(DisclosureListener listener)
          Adds a DisclosureListener.
 void encodeBegin(javax.faces.context.FacesContext context)
           
abstract  javax.faces.el.MethodBinding getDisclosureListener()
           
 DisclosureListener[] getDisclosureListeners()
          Retrieves all DisclosureListeners
 int getFirst()
           
protected  java.lang.String getLocalClientId()
          Gets the client-id of this component, minus any parent NamingContainers.
 java.util.List getPath()
          The path to the parent element.
 int getRowCount()
          Gets the total number of child elements of the current parent element.
 java.lang.Object getRowData()
          Gets the data for the current element
 int getRowIndex()
          Gets the index of the current element.
 java.lang.String getRowKey()
          Gets the row-key of the current element
 int getRows()
          Gets the maximum number of rows that this tree should show at a time.
 RowKeySet getSelectionState()
           
protected  TreeModel getTreeModel()
          Gets the TreeModel that this tree is displaying.
abstract  TreeState getTreeState()
          Gets the state associated with the expanded state of tree elements
abstract  java.lang.Object getValue()
          Gets the underlying tree model.
abstract  boolean isImmediate()
          If this returns true, then the events generated by this tree (such as DisclosureEvent) will not perform any validation.
 boolean isRowAvailable()
          Checks to see if the current element is available.
 boolean isRowContainer()
          Checks to see if the current element is a container of other elements.
 void popPath()
          Sets a new parent element.
 void processDecodes(javax.faces.context.FacesContext context)
          Decodes this component before decoding the facets.
 void pushPath()
          Sets a new parent element.
 void removeDisclosureListener(DisclosureListener listener)
          Removes a DisclosureListener.
protected  void restoreStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object stateObj)
           
protected  void saveStampState(javax.faces.context.FacesContext context, javax.faces.component.UIComponent stamp)
          saves the state of a component being used as a stamp.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setPath(java.util.List path)
          Sets a new parent element.
 void setRowIndex(int rowIndex)
          Makes an element current.
 void setRowKey(java.lang.String rowKey)
          Makes an element current.
abstract  void setTreeState(TreeState state)
          Sets the state associated with the expanded state of tree elements
 
Methods inherited from class oracle.adf.view.faces.component.CollectionBase
broadcast, getVar, processUpdates, processValidators, queueEvent
 
Methods inherited from class oracle.adf.view.faces.component.UIXComponentBase
addFacesListener, createFacesBean, decode, encodeChildren, encodeEnd, findComponent, getAttribute, getAttributes, getBeanType, getBooleanProperty, getChildCount, getChildren, getClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getFamily, 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
 
Methods inherited from interface oracle.adf.view.faces.component.CollectionComponent
getVar
 

Constructor Detail

TreeBase

public TreeBase()
Create a Tree component with the default render-type


TreeBase

protected TreeBase(java.lang.String rendererType)
Create a Tree component with the given render-type

Method Detail

getTreeState

public abstract TreeState getTreeState()
Gets the state associated with the expanded state of tree elements


setTreeState

public abstract void setTreeState(TreeState state)
Sets the state associated with the expanded state of tree elements

Parameters:
state - the new expansion state

getValue

public abstract java.lang.Object getValue()
Gets the underlying tree model.


getRowCount

public final int getRowCount()
Gets the total number of child elements of the current parent element.

Specified by:
getRowCount in interface CollectionComponent
Returns:
-1 if the number of children is not known.
See Also:
DataModel.getRowCount()

getRowData

public final java.lang.Object getRowData()
Gets the data for the current element

Specified by:
getRowData in interface CollectionComponent
Specified by:
getRowData in class CollectionBase
Returns:
null if the current element is not available
See Also:
DataModel.getRowData()

isRowAvailable

public final boolean isRowAvailable()
Checks to see if the current element is available. This is useful when the total number of elements in unknown.

Specified by:
isRowAvailable in interface CollectionComponent
Specified by:
isRowAvailable in class CollectionBase
Returns:
true if the current element is available.
See Also:
DataModel.isRowAvailable()

getRows

public final int getRows()
Gets the maximum number of rows that this tree should show at a time.

Specified by:
getRows in interface CollectionComponent
Returns:
not implemented yet.

getFirst

public final int getFirst()
Specified by:
getFirst in interface CollectionComponent
Returns:
zero-based index. not implemented yet.

getSelectionState

public final RowKeySet getSelectionState()
Specified by:
getSelectionState in interface CollectionComponent
Returns:
not implemented yet; always returns null

getRowIndex

public final int getRowIndex()
Gets the index of the current element.

Specified by:
getRowIndex in interface CollectionComponent
Returns:
-1 if the current element is not available
See Also:
DataModel.getRowIndex()

setRowIndex

public void setRowIndex(int rowIndex)
Makes an element current.

Specified by:
setRowIndex in interface CollectionComponent
Parameters:
rowIndex - the index of the element to make current. use -1 to clear the current element.
See Also:
DataModel.setRowIndex(int)

getRowKey

public final java.lang.String getRowKey()
Gets the row-key of the current element

Specified by:
getRowKey in interface CollectionComponent
Specified by:
getRowKey in class CollectionBase
Returns:
null if the current element is unavailable.
See Also:
CollectionModel.getRowKey()

setRowKey

public final void setRowKey(java.lang.String rowKey)
Makes an element current.

Specified by:
setRowKey in interface CollectionComponent
Specified by:
setRowKey in class CollectionBase
Parameters:
rowKey - the row-key of the element to make current. Use null to clear the current element.
See Also:
CollectionModel.setRowKey(java.lang.String)

getPath

public final java.util.List getPath()
The path to the parent element.

Returns:
each element is a row-key string. This defines a path from the root element of the tree to the parent element.
See Also:
TreeModel.getPath()

setPath

public final void setPath(java.util.List path)
Sets a new parent element.

Parameters:
path - each element is a row-key string. This defines a path from the root element of the tree to the new parent element.
See Also:
TreeModel.setPath(java.util.List)

pushPath

public final void pushPath()
Sets a new parent element. The row-key of the current element is appended to the end of the current path. The current element is cleared. It is legal to call this method only if isRowContainer() returns true.

See Also:
TreeModel.pushPath()

popPath

public final void popPath()
Sets a new parent element. The last row-key in the current path is removed. The element that has that row-key is made current.

See Also:
TreeModel.popPath()

isRowContainer

public final boolean isRowContainer()
Checks to see if the current element is a container of other elements.

Returns:
true if the current element contains other elements.
See Also:
TreeModel.isRowContainer()

addDisclosureListener

public final void addDisclosureListener(DisclosureListener listener)
Adds a DisclosureListener.


removeDisclosureListener

public final void removeDisclosureListener(DisclosureListener listener)
Removes a DisclosureListener.


getDisclosureListeners

public final DisclosureListener[] getDisclosureListeners()
Retrieves all DisclosureListeners


getDisclosureListener

public abstract javax.faces.el.MethodBinding getDisclosureListener()

isImmediate

public abstract boolean isImmediate()
If this returns true, then the events generated by this tree (such as DisclosureEvent) will not perform any validation.

Returns:
whether the tree is "immediate"

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class UIXComponentBase

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object stateObj)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class UIXComponentBase

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Description copied from class: CollectionBase
Decodes this component before decoding the facets. Decodes the children as many times as they are stamped.

Overrides:
processDecodes in class CollectionBase
Parameters:
context -

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class UIXComponentBase
java.io.IOException

getTreeModel

protected final TreeModel getTreeModel()
Gets the TreeModel that this tree is displaying.


getLocalClientId

protected final java.lang.String getLocalClientId()
Gets the client-id of this component, minus any parent NamingContainers. This ID has the current tree element's path and rowKey encoded, so that that tree element can be made current during decode.

Overrides:
getLocalClientId in class UIXComponentBase
Returns:
the local clientId

restoreStampState

protected void restoreStampState(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent stamp)

saveStampState

protected void saveStampState(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent stamp)
saves the state of a component being used as a stamp. This method will be called every time the current row of this table is changed.

Parameters:
context -
stamp -


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