qflib 0.99

de.qfs.lib.gui
Class LevelTreeSelectionModel

java.lang.Object
  extended byjavax.swing.tree.DefaultTreeSelectionModel
      extended byde.qfs.lib.gui.LevelTreeSelectionModel
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, javax.swing.tree.TreeSelectionModel

public class LevelTreeSelectionModel
extends javax.swing.tree.DefaultTreeSelectionModel

This class enables the selection of multiple nodes of a JTree, as long as the nodes are siblings.

Author:
Gregor Schmid
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeSelectionModel
changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionMode
 
Fields inherited from interface javax.swing.tree.TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION
 
Constructor Summary
LevelTreeSelectionModel()
          Create a new LevelTreeSelectionModel.
 
Method Summary
 void addSelectionPath(javax.swing.tree.TreePath path)
          Add a path to the selection.
 void addSelectionPaths(javax.swing.tree.TreePath[] paths)
          Add some paths to the selection.
protected  boolean canPathsBeAdded(javax.swing.tree.TreePath[] paths)
          Decide wheter some paths can be added to the selection.
protected  boolean canPathsBeRemoved(javax.swing.tree.TreePath[] paths)
          Paths can always be removed.
 void setSelectionPaths(javax.swing.tree.TreePath[] paths)
          Set the paths of the selection.
 
Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addPropertyChangeListener, addTreeSelectionListener, arePathsContiguous, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LevelTreeSelectionModel

public LevelTreeSelectionModel()
Create a new LevelTreeSelectionModel.

Method Detail

canPathsBeAdded

protected boolean canPathsBeAdded(javax.swing.tree.TreePath[] paths)
Decide wheter some paths can be added to the selection.

Parameters:
paths - The paths to add.
Returns:
True if the paths can be added.

canPathsBeRemoved

protected boolean canPathsBeRemoved(javax.swing.tree.TreePath[] paths)
Paths can always be removed.

Parameters:
paths - The paths to remove.
Returns:
Always true.

addSelectionPath

public void addSelectionPath(javax.swing.tree.TreePath path)
Add a path to the selection.

Parameters:
path - The path to add.

addSelectionPaths

public void addSelectionPaths(javax.swing.tree.TreePath[] paths)
Add some paths to the selection.

Parameters:
paths - The paths to add.

setSelectionPaths

public void setSelectionPaths(javax.swing.tree.TreePath[] paths)
Set the paths of the selection.

Parameters:
paths - The paths to set.

qflib 0.99