API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.tree. TreeSelectionModel View Source
Author(s)
Scott Violet
Since
Version
1.25 11/17/05
Serial
Hierarchy
 TreeSelectionModel
Subinterfaces
Description
public interface TreeSelectionModel
  This interface represents the current state of the selection for the tree component.
See also:   
Methods
Hide/Show inherited methods
public void addPropertyChangeListener (PropertyChangeListener listener)
  Adds a PropertyChangeListener to the listener list.
public void addSelectionPath (TreePath path)
  Adds path to the current selection.
public void addSelectionPaths (TreePath paths)
  Adds paths to the current selection.
public void addTreeSelectionListener (TreeSelectionListener x)
  Adds x to the list of listeners that are notified each time the set of selected TreePaths changes.
public void clearSelection ()
  Empties the current selection.
public TreePath getLeadSelectionPath ()
  Returns the last path that was added.
public int getLeadSelectionRow ()
  Returns the lead selection index.
public int getMaxSelectionRow ()
  Returns the largest value obtained from the RowMapper for the current set of selected TreePaths.
public int getMinSelectionRow ()
  Returns the smallest value obtained from the RowMapper for the current set of selected TreePaths.
public RowMapper getRowMapper ()
Returns the RowMapper instance that is able to map a TreePath to a row.
public int getSelectionCount ()
Returns the number of paths that are selected.
public int getSelectionMode ()
Returns the current selection mode, one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
public TreePath getSelectionPath ()
  Returns the first path in the selection.
public TreePath getSelectionPaths ()
  Returns the paths in the selection.
public int getSelectionRows ()
  Returns all of the currently selected rows.
public boolean isPathSelected (TreePath path)
Returns true if the path, path, is in the current selection.
public boolean isRowSelected (int row)
Returns true if the row identified by row is selected.
public boolean isSelectionEmpty ()
Returns true if the selection is currently empty.
public void removePropertyChangeListener (PropertyChangeListener listener)
  Removes a PropertyChangeListener from the listener list.
public void removeSelectionPath (TreePath path)
  Removes path from the selection.
public void removeSelectionPaths (TreePath paths)
  Removes paths from the selection.
public void removeTreeSelectionListener (TreeSelectionListener x)
  Removes x from the list of listeners that are notified each time the set of selected TreePaths changes.
public void resetRowSelection ()
  Updates this object's mapping from TreePaths to rows.
public void setRowMapper (RowMapper newMapper)
  Sets the RowMapper instance.
public void setSelectionMode (int mode)
  Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
public void setSelectionPath (TreePath path)
  Sets the selection to path.
public void setSelectionPaths (TreePath paths)
  Sets the selection to path.
Fields
Hide/Show inherited fields
publicfinalstatic int CONTIGUOUS_TREE_SELECTION = "2"
  Selection can only be contiguous.
publicfinalstatic int DISCONTIGUOUS_TREE_SELECTION = "4"
Selection can contain any number of items that are not necessarily contiguous.
publicfinalstatic int SINGLE_TREE_SELECTION = "1"
Selection can only contain one path at a time.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar