NextApp Echo3 Extras
v3.0.b4

nextapp.echo.extras.app.tree
Class DefaultTreeSelectionModel

java.lang.Object
  extended by nextapp.echo.extras.app.tree.DefaultTreeSelectionModel
All Implemented Interfaces:
TreeSelectionModel

public class DefaultTreeSelectionModel
extends java.lang.Object
implements TreeSelectionModel


Field Summary
 
Fields inherited from interface nextapp.echo.extras.app.tree.TreeSelectionModel
MULTIPLE_SELECTION, SELECTION_MODE_PROPERTY, SINGLE_SELECTION
 
Constructor Summary
DefaultTreeSelectionModel()
           
 
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.
protected  void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
           
protected  void fireValueChanged()
          Notifies ChangeListeners that the selection has changed.
 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 newValue)
          Sets the selection mode.
 void setSelectionPath(TreePath path)
          Sets the selection to path.
 void setSelectionPaths(TreePath[] paths)
          Sets the selection to path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTreeSelectionModel

public DefaultTreeSelectionModel()
Method Detail

addChangeListener

public void addChangeListener(nextapp.echo.app.event.ChangeListener l)
Description copied from interface: TreeSelectionModel
Adds a ChangeListener to the selection model, which will be notified when the selection changes.

Specified by:
addChangeListener in interface TreeSelectionModel
Parameters:
l - the ChangeListener to add
See Also:
TreeSelectionModel.addChangeListener(nextapp.echo.app.event.ChangeListener)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: TreeSelectionModel
Adds a PropertyChangeListener to the selection model, which will be notified on property changes.

Specified by:
addPropertyChangeListener in interface TreeSelectionModel
Parameters:
l - the PropertyChangeListener to add
See Also:
TreeSelectionModel.addPropertyChangeListener(java.beans.PropertyChangeListener)

addSelectionPath

public void addSelectionPath(TreePath path)
Description copied from interface: TreeSelectionModel
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.

Specified by:
addSelectionPath in interface TreeSelectionModel
Parameters:
path - the new path to add to the current selection
See Also:
TreeSelectionModel.addSelectionPath(nextapp.echo.extras.app.tree.TreePath)

addSelectionPaths

public void addSelectionPaths(TreePath[] paths)
Description copied from interface: TreeSelectionModel
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.

Specified by:
addSelectionPaths in interface TreeSelectionModel
Parameters:
paths - the new paths to add to the current selection
See Also:
TreeSelectionModel.addSelectionPaths(nextapp.echo.extras.app.tree.TreePath[])

clearSelection

public void clearSelection()
Description copied from interface: TreeSelectionModel
Deselects all items.

Specified by:
clearSelection in interface TreeSelectionModel
See Also:
TreeSelectionModel.clearSelection()

fireValueChanged

protected void fireValueChanged()
Notifies ChangeListeners that the selection has changed.


getSelectionMode

public int getSelectionMode()
Description copied from interface: TreeSelectionModel
Returns the selection mode.

Specified by:
getSelectionMode in interface TreeSelectionModel
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.
See Also:
TreeSelectionModel.getSelectionMode()

getSelectionPath

public TreePath getSelectionPath()
Description copied from interface: TreeSelectionModel
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.

Specified by:
getSelectionPath in interface TreeSelectionModel
See Also:
TreeSelectionModel.getSelectionPath()

getSelectionPaths

public TreePath[] getSelectionPaths()
Description copied from interface: TreeSelectionModel
Returns the paths in the selection.

Specified by:
getSelectionPaths in interface TreeSelectionModel
Returns:
the currently selected paths, or an empty array if nothing is selected
See Also:
TreeSelectionModel.getSelectionPaths()

isPathSelected

public boolean isPathSelected(TreePath path)
Description copied from interface: TreeSelectionModel
Determines whether a tree path is selected.

Specified by:
isPathSelected in interface TreeSelectionModel
Parameters:
path - the path
Returns:
true if the path is currently selected
See Also:
TreeSelectionModel.isPathSelected(nextapp.echo.extras.app.tree.TreePath)

isSelectionEmpty

public boolean isSelectionEmpty()
Description copied from interface: TreeSelectionModel
Determines if no items are selected.

Specified by:
isSelectionEmpty in interface TreeSelectionModel
Returns:
true if no items are selected
See Also:
TreeSelectionModel.isSelectionEmpty()

removeChangeListener

public void removeChangeListener(nextapp.echo.app.event.ChangeListener l)
Description copied from interface: TreeSelectionModel
Removes a ChangeListener from being notified of when the selection changes.

Specified by:
removeChangeListener in interface TreeSelectionModel
Parameters:
l - the ChangeListener to remove
See Also:
TreeSelectionModel.removeChangeListener(nextapp.echo.app.event.ChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: TreeSelectionModel
Removes a PropertyChangeListener from being notified on property changes

Specified by:
removePropertyChangeListener in interface TreeSelectionModel
Parameters:
l - the PropertyChangeListener to remove
See Also:
TreeSelectionModel.removePropertyChangeListener(java.beans.PropertyChangeListener)

removeSelectionPath

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

Specified by:
removeSelectionPath in interface TreeSelectionModel
Parameters:
path - the path to remove from the selection
See Also:
TreeSelectionModel.removeSelectionPath(nextapp.echo.extras.app.tree.TreePath)

removeSelectionPaths

public void removeSelectionPaths(TreePath[] paths)
Description copied from interface: TreeSelectionModel
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.

Specified by:
removeSelectionPaths in interface TreeSelectionModel
Parameters:
paths - the path to remove from the selection
See Also:
TreeSelectionModel.removeSelectionPaths(nextapp.echo.extras.app.tree.TreePath[])

setSelectionMode

public void setSelectionMode(int newValue)
Description copied from interface: TreeSelectionModel
Sets the selection mode.

Specified by:
setSelectionMode in interface TreeSelectionModel
Parameters:
newValue - 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.
See Also:
TreeSelectionModel.setSelectionMode(int)

firePropertyChange

protected void firePropertyChange(java.lang.String propertyName,
                                  int oldValue,
                                  int newValue)

setSelectionPath

public void setSelectionPath(TreePath path)
Description copied from interface: TreeSelectionModel
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.

Specified by:
setSelectionPath in interface TreeSelectionModel
Parameters:
path - new path to select
See Also:
TreeSelectionModel.setSelectionPath(nextapp.echo.extras.app.tree.TreePath)

setSelectionPaths

public void setSelectionPaths(TreePath[] paths)
Description copied from interface: TreeSelectionModel
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.

Specified by:
setSelectionPaths in interface TreeSelectionModel
Parameters:
paths - new selection
See Also:
TreeSelectionModel.setSelectionPaths(nextapp.echo.extras.app.tree.TreePath[])

NextApp Echo3 Extras
v3.0.b4