|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TreeModel
This interface defines the methods that component like Tree
use to get the content of items.
Note: changing a render will not cause the tree to re-render.
If you want it to re-render, you could assign the same model again
(i.e., setModel(getModel())), or fire an TreeDataEvent event.
| Method Summary | |
|---|---|
void |
addTreeDataListener(TreeDataListener l)
Add a listener to the tree that's notified each time a change to the data model occurs |
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns the child of parent at index index in the parent's child array. |
int |
getChildCount(java.lang.Object parent)
Returns the number of children of parent. |
int[] |
getPath(java.lang.Object parent,
java.lang.Object lastNode)
Returns an integer array to represent the path from parent(exclusive) to lastNode(inclusive). |
java.lang.Object |
getRoot()
Returns the root of the tree. |
boolean |
isLeaf(java.lang.Object node)
Returns true if node is a leaf. |
void |
removeTreeDataListener(TreeDataListener l)
Remove a listener to the tree that's notified each time a change to the data model occurs |
| Method Detail |
|---|
boolean isLeaf(java.lang.Object node)
node - a node in the tree, obtained from this data source
java.lang.Object getChild(java.lang.Object parent,
int index)
parent - a node in the tree, obtained from this data source
int getChildCount(java.lang.Object parent)
parent - a node in the tree, obtained from this data source
java.lang.Object getRoot()
void addTreeDataListener(TreeDataListener l)
l - the listener to addvoid removeTreeDataListener(TreeDataListener l)
l - the listener to remove
int[] getPath(java.lang.Object parent,
java.lang.Object lastNode)
parent - the origin of PathlastNode - the destination of Path
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||