oracle.adf.view.faces.model
Class TreeState

java.lang.Object
  |
  +--oracle.adf.view.faces.model.PathHelper
        |
        +--oracle.adf.view.faces.model.TreeState
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public final class TreeState
extends oracle.adf.view.faces.model.PathHelper
implements java.io.Externalizable

This class tracks the expand/collapse state of nodes in a tree.

See Also:
Serialized Form

Constructor Summary
TreeState()
           
 
Method Summary
 void collapseAll()
          Collapses the current rowKey, and all its children.
 void expandAll()
          Expands the current rowKey, and all its children.
protected  java.lang.Object getLastPathData()
           
 java.util.List getPath()
          Gets the current path.
 java.lang.String getPath(int index)
          Gets a rowKey at the specified location in the path.
protected  java.lang.Object getPathData(int index)
          Gets the path data at the specified index.
 int getPathSize()
           
 java.lang.String getRowKey()
           
 boolean isExpanded()
          Gets the expanded state of the current rowKey.
 void popPath()
          Removes the last rowKey from the end of this path.
 void pushPath()
          Pushes the current rowKey onto the path.
protected  java.lang.Object pushPath(java.lang.Object parentElement, java.lang.String rowKey)
          Gets the path data to use for a new path segment.
 void readExternal(java.io.ObjectInput in)
           
 void setExpandAllDepth(int depth)
          Sets the maximum depth of an expandAll operation.
 void setExpanded(boolean isExpanded)
          Sets the expanded state of the current rowKey.
 void setPath(java.util.List path)
          Sets the path.
 void setRowKey(java.lang.String rowKey)
          Sets the current rowKey.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeState

public TreeState()
Method Detail

setExpandAllDepth

public void setExpandAllDepth(int depth)
Sets the maximum depth of an expandAll operation. The default is 1.

Parameters:
depth - use 0 to expandAll indefinitely.

expandAll

public void expandAll()
Expands the current rowKey, and all its children.


collapseAll

public void collapseAll()
Collapses the current rowKey, and all its children.


getLastPathData

protected final java.lang.Object getLastPathData()
Overrides:
getLastPathData in class oracle.adf.view.faces.model.PathHelper
Returns:
the path data for the last element in the path.

isExpanded

public boolean isExpanded()
Gets the expanded state of the current rowKey.

Returns:
true if expanded

setExpanded

public void setExpanded(boolean isExpanded)
Sets the expanded state of the current rowKey.

Parameters:
isExpanded - true if it must be expanded

pushPath

protected final java.lang.Object pushPath(java.lang.Object parentElement,
                                          java.lang.String rowKey)
Description copied from class: oracle.adf.view.faces.model.PathHelper
Gets the path data to use for a new path segment.

Overrides:
pushPath in class oracle.adf.view.faces.model.PathHelper
Parameters:
parentElement - the path data of the previous path segment
rowKey - the path segment that is just about to be added.
Returns:
new path data, which can be retrieved using PathHelper.getPathData(int)

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException

setRowKey

public final void setRowKey(java.lang.String rowKey)
Sets the current rowKey.

Parameters:
rowKey -

getRowKey

public final java.lang.String getRowKey()
Returns:
the current row key

getPathSize

public final int getPathSize()
Returns:
the current size of the path

getPath

public final java.util.List getPath()
Gets the current path.

Returns:
a List, with each element a rowKey String

getPath

public final java.lang.String getPath(int index)
Gets a rowKey at the specified location in the path.

Parameters:
index -
Returns:
the rowKey String

setPath

public final void setPath(java.util.List path)
Sets the path.

Parameters:
path - a List with each element a rowKey String

getPathData

protected final java.lang.Object getPathData(int index)
Gets the path data at the specified index.

Parameters:
index -
Returns:
this is the path data that was set using PathHelper.pushPath(Object,String)

pushPath

public final void pushPath()
Pushes the current rowKey onto the path.


popPath

public final void popPath()
Removes the last rowKey from the end of this path. The current rowKey is set to be this last rowKey.



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