charvax.swing.tree

Interface TreeSelectionModel

public interface TreeSelectionModel

This interface represents the current state of the selection for the tree component. The Charva version of the TreeSelectionModel supports SINGLE_TREE_SELECTION only. As a result, the state of the tree selection is characterized by a single TreePath,

Method Summary

void
addTreeSelectionListener(TreeSelectionListener listener)
Adds "listener" to the list of listeners that are notified each time the set of selected TreePaths changes.
void
clearSelection()
Empties the current selection.
TreePath
getSelectionPath()
Returns the first path in the selection.
boolean
isPathSelected(TreePath path)
Returns true if "path" is in the current selection.
boolean
isSelectionEmpty()
Returns true if the selection is currently empty.
void
removeTreeSelectionListener(TreeSelectionListener listener)
Removes "listener" from the list of listeners that are notified each time the set of selected TreePaths changes.
void
setSelectionPath(TreePath path)
Sets the selection to "path".

Method Details

addTreeSelectionListener

public void addTreeSelectionListener(TreeSelectionListener listener)
Adds "listener" to the list of listeners that are notified each time the set of selected TreePaths changes.

clearSelection

public void clearSelection()
Empties the current selection.

getSelectionPath

public TreePath getSelectionPath()
Returns the first path in the selection.

isPathSelected

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

isSelectionEmpty

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

removeTreeSelectionListener

public void removeTreeSelectionListener(TreeSelectionListener listener)
Removes "listener" from the list of listeners that are notified each time the set of selected TreePaths changes.

setSelectionPath

public void setSelectionPath(TreePath path)
Sets the selection to "path".