at.spardat.xma.mdl.tree
Interface ITreeWM

All Superinterfaces:
ISelectable
All Known Subinterfaces:
ITreeWMClient
All Known Implementing Classes:
TreeWM, TreeWMClient

public interface ITreeWM
extends ISelectable

The API for a widget model that holds a tree and its selection status.


Field Summary
static int S_LAST
          The numeric highest style constant used in this class
static int S_MULTI_SELECT
          Specify this style constant in the constructor if you want the tree to allow multi selection.
 
Method Summary
 void clear()
          Removes all nodes from the tree and resets the selection information.
 boolean containsKey(java.lang.String key)
          Returns true if this tree contains a node whose key equals the one provided as parameter.
 TreeNode getNode(java.lang.String key)
          Returns the tree node for a particular key or null if there is no such node.
 int getRootCount()
          Returns the number of root nodes in this tree
 TreeNode[] getRoots()
          Returns the root nodes of this tree.
 TreeNode getSelectedNode()
          Returns the selected tree node or null if there is no such node.
 java.lang.String[] getSelectionOrdered()
          Returns a newly created array containing the ids of the selected entries in ordered by the rows on the screen.
 void selectAll()
          Selects all nodes in the tree.
 int size()
          Returns the number of nodes in this tree.
 
Methods inherited from interface at.spardat.xma.mdl.ISelectable
deselect, deselectAll, getSelected, getSelection, getSelectionCount, isMultiSelect, isSelected, isStrict, select
 

Field Detail

S_MULTI_SELECT

public static final int S_MULTI_SELECT
Specify this style constant in the constructor if you want the tree to allow multi selection. The default is single selection.

See Also:
Constant Field Values

S_LAST

public static final int S_LAST
The numeric highest style constant used in this class

See Also:
Constant Field Values
Method Detail

clear

public void clear()
Removes all nodes from the tree and resets the selection information.


size

public int size()
Returns the number of nodes in this tree.


containsKey

public boolean containsKey(java.lang.String key)
Returns true if this tree contains a node whose key equals the one provided as parameter.


getRootCount

public int getRootCount()
Returns the number of root nodes in this tree


getRoots

public TreeNode[] getRoots()
Returns the root nodes of this tree. The returned array is newly constructed so modifying it does not modify the tree.

Returns:
array of length getRootCount().

getNode

public TreeNode getNode(java.lang.String key)
Returns the tree node for a particular key or null if there is no such node.


getSelectedNode

public TreeNode getSelectedNode()
Returns the selected tree node or null if there is no such node.


selectAll

public void selectAll()
Selects all nodes in the tree. Must not be called if this tree is a single-selection-tree.


getSelectionOrdered

public java.lang.String[] getSelectionOrdered()
Returns a newly created array containing the ids of the selected entries in ordered by the rows on the screen. If nothing is selected, an empty array is returned. If you do not need this order, use getSelection() instead, which is faster.

Returns:
array of the selected keys. The length of the array equals getSelectionCount().
Since:
1.7.3