NextApp Echo3 Extras
v3.0.b4

nextapp.echo.extras.app.tree
Interface TreeSelectionModel

All Known Implementing Classes:
DefaultTreeSelectionModel

public interface TreeSelectionModel


Field Summary
static int MULTIPLE_SELECTION
           
static java.lang.String SELECTION_MODE_PROPERTY
           
static int SINGLE_SELECTION
           
 
Method Summary
 void addChangeListener(nextapp.echo.app.event.ChangeListener l)
          Adds a ChangeListener to the selection model, which will be notified when the selection changes.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a PropertyChangeListener to the selection model, which will be notified on property changes.
 void addSelectionPath(TreePath path)
          Adds path to the current selection.
 void addSelectionPaths(TreePath[] paths)
          Adds paths to the current selection.
 void clearSelection()
          Deselects all items.
 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)
          Determines whether a tree path is selected.
 boolean isSelectionEmpty()
          Determines if no items are selected.
 void removeChangeListener(nextapp.echo.app.event.ChangeListener l)
          Removes a ChangeListener from being notified of when the selection changes.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a PropertyChangeListener from being notified on property changes
 void removeSelectionPath(TreePath path)
          Removes path from the selection.
 void removeSelectionPaths(TreePath[] paths)
          Removes paths from the selection.
 void setSelectionMode(int selectionMode)
          Sets the selection mode.
 void setSelectionPath(TreePath path)
          Sets the selection to path.
 void setSelectionPaths(TreePath[] paths)
          Sets the selection to path.
 

Field Detail

SELECTION_MODE_PROPERTY

static final java.lang.String SELECTION_MODE_PROPERTY
See Also:
Constant Field Values

SINGLE_SELECTION

static final int SINGLE_SELECTION
See Also:
Constant Field Values

MULTIPLE_SELECTION

static final int MULTIPLE_SELECTION
See Also:
Constant Field Values
Method Detail

addChangeListener

void addChangeListener(nextapp.echo.app.event.ChangeListener l)
Adds a ChangeListener to the selection model, which will be notified when the selection changes.

Parameters:
l - the ChangeListener to add

addPropertyChangeListener

void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a PropertyChangeListener to the selection model, which will be notified on property changes.

Parameters:
l - the PropertyChangeListener to add

clearSelection

void clearSelection()
Deselects all items.


getSelectionPath

TreePath getSelectionPath()
Returns the first path in the selection. How first is defined is up to implementors, and may not necessarily be the TreePath with the smallest integer value as determined from the RowMapper.


getSelectionPaths

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

Returns:
the currently selected paths, or an empty array if nothing is selected

getSelectionMode

int getSelectionMode()
Returns the selection mode.

Returns:
the selection mode, one of the following values:
  • ListSelectionModel.SINGLE_SELECTION: only one list element may be selected.
  • ListSelectionModel.MULTIPLE_SELECTION: multiple list elements may be selected.

isPathSelected

boolean isPathSelected(TreePath path)
Determines whether a tree path is selected.

Parameters:
path - the path
Returns:
true if the path is currently selected

isSelectionEmpty

boolean isSelectionEmpty()
Determines if no items are selected.

Returns:
true if no items are selected

removeChangeListener

void removeChangeListener(nextapp.echo.app.event.ChangeListener l)
Removes a ChangeListener from being notified of when the selection changes.

Parameters:
l - the ChangeListener to remove

removePropertyChangeListener

void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a PropertyChangeListener from being notified on property changes

Parameters:
l - the PropertyChangeListener to remove

setSelectionPath

void setSelectionPath(TreePath path)
Sets the selection to path. If this represents a change, then the TreeSelectionListeners are notified. If path is null, this has the same effect as invoking clearSelection.

Parameters:
path - new path to select

setSelectionPaths

void setSelectionPaths(TreePath[] paths)
Sets the selection to path. If this represents a change, then the TreeSelectionListeners are notified. If paths is null, this has the same effect as invoking clearSelection.

Parameters:
paths - new selection

addSelectionPath

void addSelectionPath(TreePath path)
Adds path to the current selection. If path is not currently in the selection the TreeSelectionListeners are notified. This has no effect if path is null.

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

addSelectionPaths

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. This has no effect if paths is null.

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

removeSelectionPath

void removeSelectionPath(TreePath path)
Removes path from the selection. If path is in the selection The TreeSelectionListeners are notified. This has no effect if path is null.

Parameters:
path - the path to remove from the selection

removeSelectionPaths

void removeSelectionPaths(TreePath[] paths)
Removes paths from the selection. If any of the paths in paths are in the selection, the TreeSelectionListeners are notified. This method has no effect if paths is null.

Parameters:
paths - the path to remove from the selection

setSelectionMode

void setSelectionMode(int selectionMode)
Sets the selection mode.

Parameters:
selectionMode - the selection mode, one of the following values:
  • SINGLE_SELECTION: only one tree node may be selected.
  • MULTIPLE_SELECTION: multiple list nodes may be selected.

NextApp Echo3 Extras
v3.0.b4