Methods Summary |
---|
public void | addPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds a PropertyChangeListener to the listener list.
The listener is registered for all properties.
A PropertyChangeEvent will get fired when the selection mode
changes.
|
public void | addSelectionPath(javax.swing.tree.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.
|
public void | addSelectionPaths(javax.swing.tree.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.
|
public void | addTreeSelectionListener(javax.swing.event.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. If this represents a change in the
current selection, the selection listeners are notified.
|
public javax.swing.tree.TreePath | getLeadSelectionPath()Returns the last path that was added. This may differ from the
leadSelectionPath property maintained by the JTree.
|
public int | getLeadSelectionRow()Returns the lead selection index. That is the last index that was
added.
|
public int | getMaxSelectionRow()Returns the largest value obtained from the RowMapper for the
current set of selected TreePaths. If nothing is selected,
or there is no RowMapper, this will return -1.
|
public int | getMinSelectionRow()Returns the smallest value obtained from the RowMapper for the
current set of selected TreePaths. If nothing is selected,
or there is no RowMapper, this will return -1.
|
public javax.swing.tree.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 javax.swing.tree.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 .
|
public javax.swing.tree.TreePath[] | getSelectionPaths()Returns the paths in the selection. This will return null (or an
empty array) if nothing is currently selected.
|
public int[] | getSelectionRows()Returns all of the currently selected rows. This will return
null (or an empty array) if there are no selected TreePaths or
a RowMapper has not been set.
|
public boolean | isPathSelected(javax.swing.tree.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(java.beans.PropertyChangeListener listener)Removes a PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all properties.
|
public void | removeSelectionPath(javax.swing.tree.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.
|
public void | removeSelectionPaths(javax.swing.tree.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.
|
public void | removeTreeSelectionListener(javax.swing.event.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. This should
be invoked when the mapping from TreePaths to integers has changed
(for example, a node has been expanded).
You do not normally have to call this; JTree and its associated
listeners will invoke this for you. If you are implementing your own
view class, then you will have to invoke this.
|
public void | setRowMapper(javax.swing.tree.RowMapper newMapper)Sets the RowMapper instance. This instance is used to determine
the row for a particular TreePath.
|
public void | setSelectionMode(int mode)Sets the selection model, which must be one of SINGLE_TREE_SELECTION,
CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
This may change the selection if the current selection is not valid
for the new mode. For example, if three TreePaths are
selected when the mode is changed to SINGLE_TREE_SELECTION ,
only one TreePath will remain selected. It is up to the particular
implementation to decide what TreePath remains selected.
|
public void | setSelectionPath(javax.swing.tree.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 .
|
public void | setSelectionPaths(javax.swing.tree.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 .
|