All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.java.swing.tree.TreeSelectionModel

public interface TreeSelectionModel
This interface represents the current state of the selection for the tree component. It will keep track of the selected rows, but in order to select by row you will need to go directly to the tree.


Variable Index

 o CONTIGUOUS_TREE_SELECTION
Selection can only be contiguous.
 o DISCONTIGUOUS_TREE_SELECTION
Selection can contain any number of items that are not necessarily contiguous.
 o SINGLE_TREE_SELECTION
Selection can only contain one path at a time.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Add a PropertyChangeListener to the listener list.
 o addSelectionPath(TreePath)
Adds path to the current selection.
 o addSelectionPaths(TreePath[])
Adds paths to the current selection.
 o addTreeSelectionListener(TreeSelectionListener)
Adds x to the list of listeners that are notified each time the selection changes.
 o clearSelection()
Empties the current selection.
 o getLeadSelectionPath()
Returns the last path that was added.
 o getLeadSelectionRow()
Returns the lead selection index.
 o getMaxSelectionRow()
Gets the last selected row.
 o getMinSelectionRow()
Gets the first selected row.
 o getRowMapper()
Returns the RowMapper instance that is able to map a path to a row.
 o getSelectionCount()
Returns the number of paths that are selected.
 o getSelectionMode()
Returns the selection mode.
 o getSelectionPath()
Returns the first path in the selection.
 o getSelectionPaths()
Returns the paths in the selection.
 o getSelectionRows()
Returns all of the currently selected rows.
 o isPathSelected(TreePath)
Returns true if the path, path, is in the current selection.
 o isRowSelected(int)
Returns true if the row identitifed by row is selected.
 o isSelectionEmpty()
Returns true if the selection is currently empty.
 o removePropertyChangeListener(PropertyChangeListener)
Remove a PropertyChangeListener from the listener list.
 o removeSelectionPath(TreePath)
Removes path from the selection.
 o removeSelectionPaths(TreePath[])
Removes paths from the selection.
 o removeTreeSelectionListener(TreeSelectionListener)
Removes x from the list of listeners that are notified each time the selection changes.
 o resetRowSelection()
Updates what rows are selected.
 o setRowMapper(RowMapper)
Sets the RowMapper instance.
 o setSelectionMode(int)
Sets the selection model, which must be one of SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.
 o setSelectionPath(TreePath)
Sets the selection to path.
 o setSelectionPaths(TreePath[])
Sets the selection to the the paths.

Variables

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

 o 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.

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

Methods

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

 o getSelectionMode
 public abstract int getSelectionMode()
Returns the selection mode.

 o setSelectionPath
 public abstract 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
 o setSelectionPaths
 public abstract void setSelectionPaths(TreePath paths[])
Sets the selection to the the paths. If this represents a change the TreeSelectionListeners are notified.

Parameters:
paths - new selection.
 o addSelectionPath
 public abstract 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.
 o addSelectionPaths
 public abstract 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:
path - the new path to add to the current selection.
 o removeSelectionPath
 public abstract 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.
 o removeSelectionPaths
 public abstract 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:
path - the path to remove from the selection.
 o getSelectionPath
 public abstract TreePath getSelectionPath()
Returns the first path in the selection.

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

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

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

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

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

 o setRowMapper
 public abstract void setRowMapper(RowMapper newMapper)
Sets the RowMapper instance. This instance is used to determine what row corresponds to what path.

 o getRowMapper
 public abstract RowMapper getRowMapper()
Returns the RowMapper instance that is able to map a path to a row.

 o getSelectionRows
 public abstract int[] getSelectionRows()
Returns all of the currently selected rows.

 o getMinSelectionRow
 public abstract int getMinSelectionRow()
Gets the first selected row.

 o getMaxSelectionRow
 public abstract int getMaxSelectionRow()
Gets the last selected row.

 o isRowSelected
 public abstract boolean isRowSelected(int row)
Returns true if the row identitifed by row is selected.

 o resetRowSelection
 public abstract void resetRowSelection()
Updates what rows are selected. This can be externally called in case the location of the paths change, but not the actual paths. You do not normally need to call this.

 o getLeadSelectionRow
 public abstract int getLeadSelectionRow()
Returns the lead selection index. That is the last index that was added.

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

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

A PropertyChangeEvent will get fired in response to an explicit setFont, setBackground, or SetForeground on the current component. Note that if the current component is inheriting its foreground, background, or font from its container, then no event will be fired in response to a change in the inherited property.

Parameters:
listener - The PropertyChangeListener to be added
 o removePropertyChangeListener
 public abstract void removePropertyChangeListener(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
 o addTreeSelectionListener
 public abstract 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.
 o removeTreeSelectionListener
 public abstract 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index