|
||||||||||
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.SourceTreeModel
public class SourceTreeModel
A TreeModel
that builds a hierarchy of TraversableSource
s.
Constructor Summary | |
---|---|
SourceTreeModel(SourceResolver resolver,
String rootURL)
|
|
SourceTreeModel(SourceTreeModelDefinition definition)
|
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 obj)
Returns true if node is a leaf. |
void |
removeTreeModelListener(TreeModelListener l)
Removes a listener previously added with TreeModel.addTreeModelListener(TreeModelListener) . |
void |
setRootSource(TraversableSource src)
|
void |
setRootURL(String url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SourceTreeModel(SourceResolver resolver, String rootURL)
public SourceTreeModel(SourceTreeModelDefinition definition)
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 obj)
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
obj
- 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 void setRootURL(String url)
public void setRootSource(TraversableSource src)
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 removepublic Object getNode(TreePath path)
getNode
in interface TreeModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |