|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.extras.app.tree.AbstractTreeModel
com.sptci.echo.tree.TreeModel<T>
public class TreeModel<T extends Treeable>
© Copyright 2009 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected Root<T> |
root
The root model object for this tree. |
static String |
ROOT_NAME
The default text to use as the name of Root object. |
protected List<T> |
roots
The list of root level nodes in the tree. |
| Fields inherited from class nextapp.echo.extras.app.tree.AbstractTreeModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
TreeModel(List<T> roots)
Create a new tree model with the list of root level model objects. |
|
TreeModel(List<T> roots,
String rootName)
Create a new tree model with the list of root level model objects and with a root node with the specified name. |
|
TreeModel(Root<T> root)
Create a new tree model with the specified root node. |
|
| Method Summary | |
|---|---|
T |
getChild(Object parent,
int index)
Return the child at the specified index under the parent node in the tree. |
int |
getChildCount(Object parent)
Return the number of children under the specified parent object. |
int |
getColumnCount()
Return the number of columns displayed in the tree table. |
int |
getIndexOfChild(Object parent,
Object child)
Return the index for the specified child under the specified parent node in the tree. |
Object |
getRoot()
Return the object that represents the root of the tree. |
Object |
getValueAt(Object node,
int index)
Return the value to display in the tree for the specified object at the specified column index. |
boolean |
isLeaf(Object object)
Return true if the object (node) does not contain children. |
| Methods inherited from class nextapp.echo.extras.app.tree.AbstractTreeModel |
|---|
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getColumnClass, getColumnName, removeTreeModelListener, valueForPathChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ROOT_NAME
Root object.
""
protected final Root<T extends Treeable> root
protected final List<T extends Treeable> roots
| Constructor Detail |
|---|
public TreeModel(List<T> roots)
getRoot().
roots - The list of root level objects.
public TreeModel(List<T> roots,
String rootName)
roots - The list of root level objects.rootName - The name to use for the dummy root node.public TreeModel(Root<T> root)
root - The root node for the tree.| Method Detail |
|---|
public Object getRoot()
root if not null or the first element in the roots list.
public T getChild(Object parent,
int index)
parent - The parent node in the tree.index - The index at which the child resides.
public int getChildCount(Object parent)
parent - The parent node in the tree.
public boolean isLeaf(Object object)
true if the object (node) does not contain children.
object - The object that represents the tree node.
true if the node has children.
public int getIndexOfChild(Object parent,
Object child)
parent - The parent node in the tree.child - The child node in the tree.
public int getColumnCount()
1.
1.
public Object getValueAt(Object node,
int index)
node - The node whose display value is to be returned.index - The column index in the tree table.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||