|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiwi.ui.model.StaticTreeModel
An implementation of ITreeModel
that represents a static
hierarchical data structure. The model preloads all of the children in the
tree.
DynamicTreeModel
Inner Class Summary | |
protected class |
StaticTreeModel.TreeNode
Internal wrapper object for nodes. |
Field Summary | |
protected StaticTreeModel.TreeNode |
root
The model's root node. |
protected HierarchicalDataSource |
source
The model's data source. |
Constructor Summary | |
protected |
StaticTreeModel()
Construct a new StaticTreeModel . |
|
StaticTreeModel(HierarchicalDataSource source)
Construct a new StaticTreeModel for a given data source. |
Method Summary | |
void |
addTreeModelListener(TreeModelListener listener)
Add a TreeModelListener to this model's list of listeners. |
void |
collapse(ITreeNode node)
Collapse a node. |
void |
expand(ITreeNode node)
Expand a node. |
protected void |
fireNodeAdded(ITreeNode node,
int index,
ITreeNode parent)
Notify listeners that a node has been added. |
protected void |
fireNodeChanged(ITreeNode node)
Notify listeners that a node has changed. |
protected void |
fireNodeCollapsed(ITreeNode node)
Notify listeners that a node has been collapsed. |
protected void |
fireNodeCollapsing(ITreeNode node)
Notify listeners that a node will be collapsed. |
protected void |
fireNodeExpanded(ITreeNode node)
Notify listeners that a node has been expanded. |
protected void |
fireNodeExpanding(ITreeNode node)
Notify listeners that a node will be expanded. |
protected void |
fireNodeRemoved(ITreeNode node,
int index,
ITreeNode parent)
Notify listeners that a node has been removed. |
protected void |
fireNodeStructureChanged(ITreeNode node)
Notify listeners that the structure of the subtree rooted at a node has changed. |
int |
getChildCount(ITreeNode node)
Get the child count for a node. |
ITreeNode[] |
getChildren(ITreeNode node)
Get a node's children. |
ITreeNode |
getParent(ITreeNode node)
Get the parent of a given node. |
ITreeNode |
getRoot()
Get the root of the model. |
Object |
getValueForProperty(String property,
ITreeNode node)
Get the value of an arbitrary property for a given node. |
boolean |
isExpandable(ITreeNode node)
Determine if a node is expandable. |
boolean |
isExpanded(ITreeNode node)
Determine if a node is currently expanded. |
protected void |
loadChildren(StaticTreeModel.TreeNode node)
Load the children for a given node by consulting the data source. |
void |
removeTreeModelListener(TreeModelListener listener)
Remove a TreeModelListener from this model's list of listeners. |
protected void |
unloadChildren(StaticTreeModel.TreeNode node)
Unload the children for a given node. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected StaticTreeModel.TreeNode root
protected HierarchicalDataSource source
Constructor Detail |
protected StaticTreeModel()
StaticTreeModel
.public StaticTreeModel(HierarchicalDataSource source)
StaticTreeModel
for a given data source.source
- The data source that will provide nodes for this model.Method Detail |
public ITreeNode getParent(ITreeNode node)
node
- The node.public boolean isExpanded(ITreeNode node)
node
- The node.public boolean isExpandable(ITreeNode node)
node
- The node.public Object getValueForProperty(String property, ITreeNode node)
ITreeNode
wrapper object is passed rather than the original
object so that state information about the object within the tree can be
determined.node
- The node.property
- The name of the property.ITreeNode
public ITreeNode getRoot()
public int getChildCount(ITreeNode node)
node
- The node.public ITreeNode[] getChildren(ITreeNode node)
parent
- The node whose children should be returned.protected final void loadChildren(StaticTreeModel.TreeNode node)
node
- The node.unloadChildren(kiwi.ui.model.StaticTreeModel.TreeNode)
protected final void unloadChildren(StaticTreeModel.TreeNode node)
node
- The node.loadChildren(kiwi.ui.model.StaticTreeModel.TreeNode)
public void addTreeModelListener(TreeModelListener listener)
TreeModelListener
to this model's list of listeners.listener
- The listener to be added.removeTreeModelListener(kiwi.event.TreeModelListener)
public void removeTreeModelListener(TreeModelListener listener)
TreeModelListener from this model's list of listeners.
- Specified by:
- removeTreeModelListener in interface ITreeModel
- Parameters:
listener
- The listener to remove.- See Also:
addTreeModelListener(kiwi.event.TreeModelListener)
protected final void fireNodeExpanding(ITreeNode node)
node
- The node that will be expanded.protected final void fireNodeExpanded(ITreeNode node)
node
- The node that was expanded.protected final void fireNodeCollapsing(ITreeNode node)
node
- The node that will be collapsed.protected final void fireNodeCollapsed(ITreeNode node)
node
- The node that was collapsed.protected final void fireNodeAdded(ITreeNode node, int index, ITreeNode parent)
node
- The new node.index
- The index of the new node in its parent's list of children.parent
- The parent of the new node.protected final void fireNodeRemoved(ITreeNode node, int index, ITreeNode parent)
node
- The node that was removed.parent
- The parent of the removed node.protected final void fireNodeChanged(ITreeNode node)
node
- The node that changed.protected final void fireNodeStructureChanged(ITreeNode node)
node
- The node that is the root of the subtree.public void expand(ITreeNode node)
TreeModelEvent
to notify listeners
when th children should be displayed.node
- The node to expand.public void collapse(ITreeNode node)
TreeModelEvent
to notify listeners
when the children should be hidden.node
- The node to collapse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |