public class IlpDefaultTreeSelectionModel extends DefaultTreeSelectionModel implements IlpTreeSelectionModel
IlpTreeSelectionModel.
This model maintains the selection of IlpObjects as well as
IlpRepresentationObjects.
In addition to the common TreePath and Row
interfaces, Object and RepresentationObject
interfaces are provided, which allows you to manipulate the selection of
IlpObjects and IlpTreeNodes directly.
We strongly discourages the use of the Row interface and the
CONTIGUOUS_TREE_SELECTION mode with IlpTreeView. In
particular, you should be aware that the Row interface ignores
the hidden nodes (descendants of collapsed nodes). So a node that
is selected but hidden will not be returned by
getSelectionRows().
In addition, contiguity is based on the expanded nodes, so you may lose
selected hidden nodes when using CONTIGUOUS_TREE_SELECTION.
changeSupport, leadIndex, leadPath, leadRow, listenerList, listSelectionModel, rowMapper, selection, SELECTION_MODE_PROPERTY, selectionModeCONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION, SINGLE_TREE_SELECTION| Constructor and Description |
|---|
IlpDefaultTreeSelectionModel()
Creates a new instance of
IlpTreeSelectionModel that is
empty, with a selection mode of DISCONTIGUOUS_TREE_SELECTION. |
| Modifier and Type | Method and Description |
|---|---|
void |
addSelectionObject(IlpObject object)
Adds the given
IlpObject to the selection. |
void |
addSelectionRepresentationObject(IlpRepresentationObject object)
Adds
object to the current selection. |
void |
addSelectionRepresentationObjects(Collection objects)
Adds
objects to the current selection. |
IlpRepresentationObject |
getLeadSelectionRepresentationObject()
Returns the last object that was added.
|
IlpRepresentationObjectMapper |
getRepresentationObjectMapper()
Returns the
IlpRepresentationObjectMapper used
to find the IlpRepresentationObject associated
with an IlpObject. |
IlpObject |
getSelectedObject()
Returns the first selected
IlpObject
from the collection of selected objects. |
Collection |
getSelectedObjects()
Returns the set of selected
IlpObjects. |
IlpRepresentationObject |
getSelectedRepresentationObject()
Returns the first object in the selection.
|
Collection |
getSelectedRepresentationObjects()
Returns the objects in the selection.
|
TreePath |
getTreePathFor(IlpRepresentationObject object)
Returns the tree path corresponding to a given representation object.
|
TreePath[] |
getTreePathsFor(Collection objects)
Returns the tree paths corresponding to a given set of representation
objects.
|
boolean |
isObjectSelected(IlpObject object)
|
boolean |
isRepresentationObjectSelected(IlpRepresentationObject object)
Returns true if
object is in the current
selection. |
void |
removeSelectionObject(IlpObject object)
Removes the given
IlpObject from the selection. |
void |
removeSelectionRepresentationObject(IlpRepresentationObject object)
Removes
object from the selection. |
void |
removeSelectionRepresentationObjects(Collection objects)
Removes
objects from the selection. |
void |
setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
Sets the
IlpRepresentationObjectMapper which will
be used to find the IlpRepresentationObject
associated with an IlpObject. |
void |
setSelectedObject(IlpObject object)
Sets the selected
IlpObject. |
void |
setSelectedObjects(Collection objects)
Sets the set of selected
IlpObjects. |
void |
setSelectedRepresentationObject(IlpRepresentationObject object)
Sets the selection to
object. |
void |
setSelectedRepresentationObjects(Collection objects)
Sets the selection to the representation objects in
objects. |
void |
setSelectionRepresentationObject(IlpRepresentationObject object)
Deprecated.
Please use
setSelectedRepresentationObject instead. |
void |
setSelectionRepresentationObjects(Collection objects)
Deprecated.
Please use
setSelectedRepresentationObjects instead. |
addPropertyChangeListener, addSelectionPath, addSelectionPaths, 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, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, setSelectionPaths, toString, updateLeadIndexequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addSelectionPath, addSelectionPaths, addTreeSelectionListener, clearSelection, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getRowMapper, getSelectionCount, getSelectionMode, getSelectionPath, getSelectionPaths, getSelectionRows, isPathSelected, isRowSelected, isSelectionEmpty, removePropertyChangeListener, removeSelectionPath, removeSelectionPaths, removeTreeSelectionListener, resetRowSelection, setRowMapper, setSelectionMode, setSelectionPath, setSelectionPathsclearSelectionclearSelectionpublic IlpDefaultTreeSelectionModel()
IlpTreeSelectionModel that is
empty, with a selection mode of DISCONTIGUOUS_TREE_SELECTION.public void addSelectionRepresentationObject(IlpRepresentationObject object)
object to the current selection. If object is
not currently in the selection the TreeSelectionListeners are notified.
This has no effect if object is null.addSelectionRepresentationObject in interface IlpRepresentationObjectSelectionModelobject - The new object to add to the current selection.public void addSelectionRepresentationObjects(Collection objects)
objects to the current selection. If any of the
representation objects in objects are not currently in the
selection the TreeSelectionListeners are notified. This has
no effect if objects is null.
The lead path is set to the last element in objects.
If the selection mode is CONTIGUOUS_TREE_SELECTION
and adding the new objects would make the selection discontiguous,
one of two situations may occur: if the IlpRepresentationObjects
in objects are contiguous, these
IlpRepresentationObjects will become the selection; otherwise, the
IlpRepresentationObjects are not contiguous and the first IlpRepresentationObject in
objects becomes the selection.
addSelectionRepresentationObjects in interface IlpTreeSelectionModelobjects - The new objects to add to the current selection.public void removeSelectionRepresentationObject(IlpRepresentationObject object)
object from the selection. If object is in
the selection, the TreeSelectionListeners are notified. This has no effect
if object is null.removeSelectionRepresentationObject in interface IlpRepresentationObjectSelectionModelobject - The object to remove from the selection.public void removeSelectionRepresentationObjects(Collection objects)
objects from the selection. If any of the objects in
objects are in the selection the TreeSelectionListeners are
notified. This has no effect if objects is null.removeSelectionRepresentationObjects in interface IlpTreeSelectionModelremoveSelectionRepresentationObjects in interface IlpRepresentationObjectSelectionModelobjects - The objects to remove from the selection.@Deprecated public void setSelectionRepresentationObject(IlpRepresentationObject object)
setSelectedRepresentationObject instead.object. If this represents a change, then
the TreeSelectionListeners are notified. If object is
null, this has the same effect as invoking
clearSelection.setSelectionRepresentationObject in interface IlpTreeSelectionModelobject - New object to select.public void setSelectedRepresentationObject(IlpRepresentationObject object)
object. If this represents a change, then
the TreeSelectionListeners are notified. If object is
null, this has the same effect as invoking
clearSelection.setSelectedRepresentationObject in interface IlpTreeSelectionModelsetSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModelobject - New object to select.public Collection getSelectedRepresentationObjects()
getSelectedRepresentationObjects in interface IlpRepresentationObjectSelectionModelIlpRepresentationObjectspublic IlpRepresentationObject getSelectedRepresentationObject()
getSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModelnull if
the selection is empty.@Deprecated public void setSelectionRepresentationObjects(Collection objects)
setSelectedRepresentationObjects instead.objects.
If this represents a change the TreeSelectionListeners are notified.
If objects is null, this has the same effect as invoking
clearSelection.
The lead path is set to the last object in objects.
If the selection mode is CONTIGUOUS_TREE_SELECTION
and adding the new objects would make the selection discontiguous,
the selection will be reset to the first IlpRepresentationObject in
objects.
setSelectionRepresentationObjects in interface IlpTreeSelectionModelobjects - New selection.public void setSelectedRepresentationObjects(Collection objects)
objects.
If this represents a change the TreeSelectionListeners are notified.
If objects is null, this has the same effect as invoking
clearSelection.
The lead path is set to the last object in objects.
If the selection mode is CONTIGUOUS_TREE_SELECTION
and adding the new objects would make the selection discontiguous,
the selection will be reset to the first IlpRepresentationObject in
objects.
setSelectedRepresentationObjects in interface IlpRepresentationObjectSelectionModelobjects - New selection.public boolean isRepresentationObjectSelected(IlpRepresentationObject object)
object is in the current
selection.isRepresentationObjectSelected in interface IlpRepresentationObjectSelectionModelobject - The representation object that may be selected.public IlpRepresentationObject getLeadSelectionRepresentationObject()
getLeadSelectionRepresentationObject in interface IlpTreeSelectionModelpublic TreePath getTreePathFor(IlpRepresentationObject object)
object - The representation object whose tree path is required.public TreePath[] getTreePathsFor(Collection objects)
objects - The representation objects whose tree paths are required.public IlpObject getSelectedObject()
IlpObject
from the collection of selected objects.
Returns null if there is no selected object.getSelectedObject in interface IlpObjectSelectionModelpublic Collection getSelectedObjects()
IlpObjects.
The set should be ordered if the component implementing this interface
supports an ordered selection.
Returns an empty set if there is no selected object.getSelectedObjects in interface IlpObjectSelectionModelIlpObjects.public void setSelectedObject(IlpObject object)
IlpObject.
This has no effect if the given object is already selected.setSelectedObject in interface IlpObjectSelectionModelobject - The object that will become the selection.public void setSelectedObjects(Collection objects)
IlpObjects.setSelectedObjects in interface IlpObjectSelectionModelobjects - The collection of objects that will become the selection.public boolean isObjectSelected(IlpObject object)
isObjectSelected in interface IlpObjectSelectionModelobject - The object which may be selected.public void addSelectionObject(IlpObject object)
IlpObject to the selection.
This has no effect if the given object is null.addSelectionObject in interface IlpObjectSelectionModelobject - The object that will be added to the selection.public void removeSelectionObject(IlpObject object)
IlpObject from the selection.
This has no effect if the given object is null.removeSelectionObject in interface IlpObjectSelectionModelobject - The object that will be removed from the selection.public void setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
IlpRepresentationObjectMapper which will
be used to find the IlpRepresentationObject
associated with an IlpObject.setRepresentationObjectMapper in interface IlpTreeSelectionModelrepresentationObjectMapper - The representation object mapper to be
used. If this parameter is null, the
IlpObject selection API has no effect.public IlpRepresentationObjectMapper getRepresentationObjectMapper()
IlpRepresentationObjectMapper used
to find the IlpRepresentationObject associated
with an IlpObject.getRepresentationObjectMapper in interface IlpTreeSelectionModelnull.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.