|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TreeModel
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 |
---|
Object getRoot()
null
only if the tree has no nodes.
Collection getChildren(Object parent)
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 leafString getChildKey(Object parent, Object child)
Object getChild(Object parent, String key)
Object getNode(TreePath path)
void addTreeModelListener(TreeModelListener l)
TreeModelEvent
posted after the tree changes.
l
- the listener to addvoid 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 |