EchoPoint
1.0

echopoint.tree
Interface TreeSelectionModel

All Known Implementing Classes:
DefaultTreeSelectionModel

public interface TreeSelectionModel

This interface represents the current state of the selection for the tree component.


Field Summary
static int CONTIGUOUS_TREE_SELECTION
          Selection can only be contiguous.
static int DISCONTIGUOUS_TREE_SELECTION
          Selection can contain any number of items that are not necessarily contiguous.
static int SINGLE_TREE_SELECTION
          Selection can only contain one path at a time.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void addSelectionPath(TreePath path)
          Adds path to the current selection.
 void addSelectionPaths(TreePath[] paths)
          Adds paths to the current selection.
 void addTreeSelectionListener(TreeSelectionListener x)
          Adds x to the list of listeners that are notified each time the selection changes.
 void clearSelection()
          Empties the current selection.
 TreePath getLeadSelectionPath()
          Returns the last path that was added.
 int getSelectionCount()
          Returns the number of paths that are selected.
 int getSelectionMode()
          Returns the selection mode.
 TreePath getSelectionPath()
          Returns the first path in the selection.
 TreePath[] getSelectionPaths()
          Returns the paths in the selection.
 boolean isPathSelected(TreePath path)
          Returns true if the path, path, is in the current selection.
 boolean isSelectionEmpty()
          Returns true if the selection is currently empty.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void removeSelectionPath(TreePath path)
          Removes path from the selection.
 void removeSelectionPaths(TreePath[] paths)
          Removes paths from the selection.
 void removeTreeSelectionListener(TreeSelectionListener x)
          Removes x from the list of listeners that are notified each time the selection changes.
 void setSelectionMode(int mode)
          Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
 void setSelectionPath(TreePath path)
          Sets the selection to path.
 void setSelectionPaths(TreePath[] paths)
          Sets the selection to the the paths.
 

Field Detail

CONTIGUOUS_TREE_SELECTION

public static final int CONTIGUOUS_TREE_SELECTION
Selection can only be contiguous. This will only be enforced if a RowMapper instance is provided.

See Also:
Constant Field Values

DISCONTIGUOUS_TREE_SELECTION

public static final int DISCONTIGUOUS_TREE_SELECTION
Selection can contain any number of items that are not necessarily contiguous.

See Also:
Constant Field Values

SINGLE_TREE_SELECTION

public static final int SINGLE_TREE_SELECTION
Selection can only contain one path at a time.

See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - The PropertyChangeListener to be added

addSelectionPath

public void addSelectionPath(TreePath path)
Adds path to the current selection. If path is not currently in the selection the TreeSelectionListeners are notified.

Parameters:
path - the new path to add to the current selection.

addSelectionPaths

public void addSelectionPaths(TreePath[] paths)
Adds paths to the current selection. If any of the paths in paths are not currently in the selection the TreeSelectionListeners are notified.

Parameters:
paths - the new paths to add to the current selection.

addTreeSelectionListener

public void addTreeSelectionListener(TreeSelectionListener x)
Adds x to the list of listeners that are notified each time the selection changes.

Parameters:
x - the new listener to be added.

clearSelection

public void clearSelection()
Empties the current selection. If this represents a change in the current selection, the selection listeners are notified.


getLeadSelectionPath

public TreePath getLeadSelectionPath()
Returns the last path that was added.


getSelectionCount

public int getSelectionCount()
Returns the number of paths that are selected.


getSelectionMode

public int getSelectionMode()
Returns the selection mode.


getSelectionPath

public TreePath getSelectionPath()
Returns the first path in the selection.


getSelectionPaths

public TreePath[] getSelectionPaths()
Returns the paths in the selection.


isPathSelected

public boolean isPathSelected(TreePath path)
Returns true if the path, path, is in the current selection.


isSelectionEmpty

public boolean isSelectionEmpty()
Returns true if the selection is currently empty.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - The PropertyChangeListener to be removed

removeSelectionPath

public void removeSelectionPath(TreePath path)
Removes path from the selection. If path is in the selection The TreeSelectionListeners are notified.

Parameters:
path - the path to remove from the selection.

removeSelectionPaths

public void removeSelectionPaths(TreePath[] paths)
Removes paths from the selection. If any of the paths in paths are in the selection the TreeSelectionListeners are notified.

Parameters:
paths - the paths to remove from the selection.

removeTreeSelectionListener

public void removeTreeSelectionListener(TreeSelectionListener x)
Removes x from the list of listeners that are notified each time the selection changes.

Parameters:
x - the listener to remove.

setSelectionMode

public void setSelectionMode(int mode)
Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.


setSelectionPath

public void setSelectionPath(TreePath path)
Sets the selection to path. If this represents a change, then the TreeSelectionListeners are notified.

Parameters:
path - new path to select

setSelectionPaths

public void setSelectionPaths(TreePath[] paths)
Sets the selection to the the paths. If this represents a change the TreeSelectionListeners are notified.

Parameters:
paths - new selection.

EchoPoint
1.0