javax.swing
Class JTree.EmptySelectionModel

java.lang.Object
  extended by javax.swing.tree.DefaultTreeSelectionModel
      extended by javax.swing.JTree.EmptySelectionModel
All Implemented Interfaces:
Serializable, Cloneable, TreeSelectionModel
Enclosing class:
JTree

protected static class JTree.EmptySelectionModel
extends DefaultTreeSelectionModel

A TreeModel that does not allow anything to be selected.

See Also:
Serialized Form

Field Summary
protected static JTree.EmptySelectionModel sharedInstance
          The shared instance of this model.
 
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
protected JTree.EmptySelectionModel()
          Creates a new instance of EmptySelectionModel.
 
Method Summary
 void addSelectionPaths(TreePath[] paths)
          This catches attempts to add something to the selection.
 void removeSelectionPaths(TreePath[] paths)
          This catches attempts to remove something from the selection.
 void setSelectionPaths(TreePath[] paths)
          This catches attempts to set a selection and sets nothing instead.
static JTree.EmptySelectionModel sharedInstance()
          Returns the shared instance of EmptySelectionModel.
 
Methods inherited from class javax.swing.tree.DefaultTreeSelectionModel
addPropertyChangeListener, addSelectionPath, addTreeSelectionListener, arePathsContiguous, canPathsBeAdded, canPathsBeRemoved, clearSelection, clone, fireValueChanged, getLeadSelectionPath, getLeadSelectionRow, getListeners, getMaxSelectionRow, getMinSelectionRow, getPropertyChangeListeners, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, getTreeSelectionListeners, insureRowContinuity, insureUniqueness, isPathSelected, isRowSelected, isSelectionEmpty, notifyPathChange, removePropertyChangeListener, removeSelectionPath, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, toString, updateLeadIndex
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sharedInstance

protected static final JTree.EmptySelectionModel sharedInstance
The shared instance of this model.

Constructor Detail

JTree.EmptySelectionModel

protected JTree.EmptySelectionModel()
Creates a new instance of EmptySelectionModel.

Method Detail

sharedInstance

public static JTree.EmptySelectionModel sharedInstance()
Returns the shared instance of EmptySelectionModel.

Returns:
the shared instance of EmptySelectionModel

setSelectionPaths

public void setSelectionPaths(TreePath[] paths)
This catches attempts to set a selection and sets nothing instead.

Specified by:
setSelectionPaths in interface TreeSelectionModel
Overrides:
setSelectionPaths in class DefaultTreeSelectionModel
Parameters:
paths - not used here

addSelectionPaths

public void addSelectionPaths(TreePath[] paths)
This catches attempts to add something to the selection.

Specified by:
addSelectionPaths in interface TreeSelectionModel
Overrides:
addSelectionPaths in class DefaultTreeSelectionModel
Parameters:
paths - not used here

removeSelectionPaths

public void removeSelectionPaths(TreePath[] paths)
This catches attempts to remove something from the selection.

Specified by:
removeSelectionPaths in interface TreeSelectionModel
Overrides:
removeSelectionPaths in class DefaultTreeSelectionModel
Parameters:
paths - not used here