kiwi.ui.model
Interface HierarchicalDataSource

All Known Implementing Classes:
DocumentDataSource, FilesystemDataSource

public abstract interface HierarchicalDataSource

This interface defines a data source for populating hierarchical data structures such as trees.

Version:
1.1 (11/98)
Author:
Mark Lindner, PING Software Group

Field Summary
static String EXPANDABLE_PROPERTY
          The "expandable" property.
static String ICON_PROPERTY
          The "icon" property.
static String LABEL_PROPERTY
          The "label" property.
 
Method Summary
 Object[] getChildren(ITreeNode node)
          Get the children of a given node in the tree.
 Object getRoot()
          Get the root object.
 Object getValueForProperty(ITreeNode node, String property)
          Get the value of an arbitrary property for a given node.
 

Field Detail

EXPANDABLE_PROPERTY

public static final String EXPANDABLE_PROPERTY
The "expandable" property. Non-leaf nodes are expandable, but an expandable node does not necessarily have children.

LABEL_PROPERTY

public static final String LABEL_PROPERTY
The "label" property. A human-readable name for a node.

ICON_PROPERTY

public static final String ICON_PROPERTY
The "icon" property. An icon for depicting this node graphically.
Method Detail

getRoot

public Object getRoot()
Get the root object.

getChildren

public Object[] getChildren(ITreeNode node)
Get the children of a given node in the tree.
Parameters:
node - The node that children are being requested for.
Returns:
A (possibly empty) array of children for the node.
See Also:
ITreeNode

getValueForProperty

public Object getValueForProperty(ITreeNode node,
                                  String property)
Get the value of an arbitrary property for a given node. An ITreeNode wrapper object is passed rather than the original object so that state information about the object within the tree can be determined.
Parameters:
node - The node.
property - The name of the property; one of the constants defined above, or some arbitrary application-defined property.
Returns:
The value of the specified property, or null if there is no value for this property.
See Also:
ITreeNode