Class JTree.EmptySelectionModel
java.lang.Object
javax.swing.tree.DefaultTreeSelectionModel
javax.swing.JTree.EmptySelectionModel
- All Implemented Interfaces:
Serializable, Cloneable, TreeSelectionModel
- Enclosing class:
JTree
EmptySelectionModel is a TreeSelectionModel
that does not allow anything to be selected.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see XMLEncoder.
- Since:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final JTree.EmptySelectionModelThe single instance ofEmptySelectionModel.Fields declared in class DefaultTreeSelectionModel
changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionModeModifier and TypeFieldDescriptionprotected SwingPropertyChangeSupportUsed to messaged registered listeners.protected intIndex of the lead path in selection.protected TreePathLast path that was added.protected intLead row.protected EventListenerListEvent listener list.protected DefaultListSelectionModelHandles maintaining the list selection model.protected RowMapperProvides a row for a given path.protected TreePath[]Paths that are currently selected.static final StringProperty name for selectionMode.protected intMode for the selection, will be either SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION or DISCONTIGUOUS_TREE_SELECTION.Fields declared in interface TreeSelectionModel
CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTIONModifier and TypeFieldDescriptionstatic final intSelection can only be contiguous.static final intSelection can contain any number of items that are not necessarily contiguous.static final intSelection can only contain one path at a time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidaddSelectionPaths(TreePath[] paths) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidThis is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidThis is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidremoveSelectionPaths(TreePath[] paths) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidThis is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidsetRowMapper(RowMapper mapper) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidsetSelectionMode(int mode) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.voidsetSelectionPaths(TreePath[] paths) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.static JTree.EmptySelectionModelReturns the single instance ofEmptySelectionModel.Methods declared in class DefaultTreeSelectionModel
addSelectionPath, 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, removeSelectionPath, resetRowSelection, setSelectionPath, toString, updateLeadIndexModifier and TypeMethodDescriptionvoidaddSelectionPath(TreePath path) Adds path to the current selection.protected booleanarePathsContiguous(TreePath[] paths) Returns true if the paths are contiguous, or this object has no RowMapper.protected booleancanPathsBeAdded(TreePath[] paths) Used to test if a particular set ofTreePaths can be added.protected booleancanPathsBeRemoved(TreePath[] paths) Returns true if the paths can be removed without breaking the continuity of the model.voidEmpties the current selection.clone()Returns a clone of this object with the same selection.protected voidNotifies all listeners that are registered for tree selection events on this object.Returns the last path that was added.intReturns the lead selection index.<T extends EventListener>
T[]getListeners(Class<T> listenerType) Returns an array of all the objects currently registered asFooListeners upon this model.intReturns the largest value obtained from the RowMapper for the current set of selected TreePaths.intReturns the smallest value obtained from the RowMapper for the current set of selected TreePaths.Returns an array of all the property change listeners registered on thisDefaultTreeSelectionModel.Returns the RowMapper instance that is able to map a TreePath to a row.intReturns the number of paths that are selected.intReturns the selection mode, one ofSINGLE_TREE_SELECTION,DISCONTIGUOUS_TREE_SELECTIONorCONTIGUOUS_TREE_SELECTION.Returns the first path in the selection.TreePath[]Returns the selection.int[]Returns the selection in terms of rows.Returns an array of all the tree selection listeners registered on this model.protected voidMakes sure the currently selectedTreePaths are valid for the current selection mode.protected voidThis method is obsolete and its implementation is now a noop.booleanisPathSelected(TreePath path) Returns true if the path,path, is in the current selection.booleanisRowSelected(int row) Returns true if the row identified byrowis selected.booleanReturns true if the selection is currently empty.protected voidnotifyPathChange(Vector<?> changedPaths, TreePath oldLeadSelection) Deprecated.As of JDK version 1.7voidremoveSelectionPath(TreePath path) Removes path from the selection.voidUpdates this object's mapping from TreePath to rows.voidsetSelectionPath(TreePath path) Sets the selection to path.toString()Returns a string that displays and identifies this object's properties.protected voidUpdates the leadIndex instance variable.Methods declared in class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
Constructor Details
-
EmptySelectionModel
protected EmptySelectionModel()Constructs anEmptySelectionModel.
-
-
Method Details
-
setSelectionPaths
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
setSelectionPathsin interfaceTreeSelectionModel- Overrides:
setSelectionPathsin classDefaultTreeSelectionModel- Parameters:
paths- the paths to select; this is ignored
-
addSelectionPaths
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
addSelectionPathsin interfaceTreeSelectionModel- Overrides:
addSelectionPathsin classDefaultTreeSelectionModel- Parameters:
paths- the paths to add to the selection; this is ignored
-
removeSelectionPaths
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
removeSelectionPathsin interfaceTreeSelectionModel- Overrides:
removeSelectionPathsin classDefaultTreeSelectionModel- Parameters:
paths- the paths to remove; this is ignored
-
setSelectionMode
public void setSelectionMode(int mode) This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
setSelectionModein interfaceTreeSelectionModel- Overrides:
setSelectionModein classDefaultTreeSelectionModel- Parameters:
mode- the selection mode; this is ignored- Since:
- 1.7
-
setRowMapper
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
setRowMapperin interfaceTreeSelectionModel- Overrides:
setRowMapperin classDefaultTreeSelectionModel- Parameters:
mapper- theRowMapperinstance; this is ignored- Since:
- 1.7
-
addTreeSelectionListener
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
addTreeSelectionListenerin interfaceTreeSelectionModel- Overrides:
addTreeSelectionListenerin classDefaultTreeSelectionModel- Parameters:
listener- the listener to add; this is ignored- Since:
- 1.7
-
removeTreeSelectionListener
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
removeTreeSelectionListenerin interfaceTreeSelectionModel- Overrides:
removeTreeSelectionListenerin classDefaultTreeSelectionModel- Parameters:
listener- the listener to remove; this is ignored- Since:
- 1.7
-
addPropertyChangeListener
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
addPropertyChangeListenerin interfaceTreeSelectionModel- Overrides:
addPropertyChangeListenerin classDefaultTreeSelectionModel- Parameters:
listener- the listener to add; this is ignored- Since:
- 1.7
-
removePropertyChangeListener
This is overridden to do nothing;EmptySelectionModeldoes not allow a selection.- Specified by:
removePropertyChangeListenerin interfaceTreeSelectionModel- Overrides:
removePropertyChangeListenerin classDefaultTreeSelectionModel- Parameters:
listener- the listener to remove; this is ignored- Since:
- 1.7