|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.forms.formmodel.tree.DefaultTreeModel
public class DefaultTreeModel
A default tree model, implemented with DefaultTreeModel.TreeNode
s.
Nested Class Summary | |
---|---|
static class |
DefaultTreeModel.DefaultTreeNode
|
static class |
DefaultTreeModel.Sample
The classical Swing sample tree model, that can be used for demonstration purposes. |
static interface |
DefaultTreeModel.TreeNode
|
Field Summary | |
---|---|
static TreeModel |
UNSPECIFIED_MODEL
Default model that is used by a Tree when no model has been specified. |
Constructor Summary | |
---|---|
DefaultTreeModel(DefaultTreeModel.TreeNode root)
|
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 TreeModel.addTreeModelListener(TreeModelListener) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final TreeModel UNSPECIFIED_MODEL
Constructor Detail |
---|
public DefaultTreeModel(DefaultTreeModel.TreeNode root)
Method Detail |
---|
public Object getRoot()
TreeModel
null
only if the tree has no nodes.
getRoot
in interface TreeModel
public Collection getChildren(Object parent)
getChildren
in interface TreeModel
public boolean isLeaf(Object node)
TreeModel
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.
isLeaf
in interface TreeModel
node
- a node in the tree, obtained from this data source
node
is a leafpublic String getChildKey(Object parent, Object child)
getChildKey
in interface TreeModel
public Object getChild(Object parent, String key)
getChild
in interface TreeModel
public Object getNode(TreePath path)
getNode
in interface TreeModel
public void addTreeModelListener(TreeModelListener l)
TreeModel
TreeModelEvent
posted after the tree changes.
addTreeModelListener
in interface TreeModel
l
- the listener to addpublic void removeTreeModelListener(TreeModelListener l)
TreeModel
TreeModel.addTreeModelListener(TreeModelListener)
.
removeTreeModelListener
in interface TreeModel
l
- the listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |