|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Data model for the Tree
widget, inspired by Swing's TreeModel
, with
the difference that child nodes are accessed through keys rather than indices.
Method Summary | |
void |
addTreeModelListener(TreeModelListener l)
Adds a listener for the TreeModelEvent posted after the tree changes. |
Object |
getChild(Object parent,
String key)
|
String |
getChildKey(Object parent,
Object child)
|
Collection |
getChildren(Object parent)
|
Object |
getNode(TreePath path)
|
Object |
getRoot()
Returns the root of the tree. |
boolean |
isLeaf(Object node)
Returns true if node is a leaf. |
void |
removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with addTreeModelListener(TreeModelListener) . |
Method Detail |
public Object getRoot()
null
only if the tree has no nodes.
public Collection getChildren(Object parent)
public boolean isLeaf(Object node)
true
if node
is a leaf.
It is possible for this method to return false
even if node
has no children.
A directory in a filesystem, for example,
may contain no files; the node representing
the directory is not a leaf, but it also has no children.
node
- a node in the tree, obtained from this data source
node
is a leafpublic String getChildKey(Object parent, Object child)
public Object getChild(Object parent, String key)
public Object getNode(TreePath path)
public void addTreeModelListener(TreeModelListener l)
TreeModelEvent
posted after the tree changes.
l
- the listener to addpublic void removeTreeModelListener(TreeModelListener l)
addTreeModelListener(TreeModelListener)
.
l
- the listener to remove
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |