public class IlpDefaultTableSelectionModel extends Object implements IlpTableSelectionModel
IlpRepresentationObject
s.
This class delegates the work to the right selection model according to
the chosen selection mode.Constructor and Description |
---|
IlpDefaultTableSelectionModel()
Default constructor
|
IlpDefaultTableSelectionModel(IlpTableSelectionMode selectionMode)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSelection(IlpArea area)
Adds an
IlpArea to the selection. |
void |
addSelection(IlpRepresentationObject object,
IlpAttribute attribute)
Adds a new selection.
|
void |
addSelectionListener(TableSelectionListener listener)
Registers a listener to selection change events.
|
void |
addSelectionObject(IlpObject object)
Adds the given
IlpObject to the selection. |
void |
addSelectionRepresentationObject(IlpRepresentationObject object)
Adds the given
IlpRepresentationObject to the
selection. |
void |
clearSelection()
Clears the selection.
|
IlpAttribute |
getAnchorAttribute()
Returns the attribute which has the focus.
|
IlpRepresentationObject |
getAnchorObject()
Returns the representation object that has the focus.
|
IlpArea |
getLeadSelection()
Retrieves the
IlpArea composing the temporary lead selection. |
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
IlpObject s. |
IlpRepresentationObject |
getSelectedRepresentationObject()
Returns the first selected
IlpRepresentationObject
from the collection of selected representation objects. |
Collection |
getSelectedRepresentationObjects()
Returns the set of selected
IlpRepresentationObject s. |
Collection |
getSelection()
Retrieves the collection of
IlpArea s composing the selection. |
IlpTableSelectionMode |
getSelectionMode()
Returns the selection mode.
|
boolean |
isAdjusting()
Returns if the selection model is currently being adjusted.
|
boolean |
isObjectSelected(IlpObject object)
|
boolean |
isRepresentationObjectSelected(IlpRepresentationObject object)
|
boolean |
isSelected(IlpArea area)
Returns whether an
IlpArea is selected. |
boolean |
isSelected(IlpRepresentationObject object,
IlpAttribute attribute)
Returns whether cell (that is, an attribute for a representation object) is
selected.
|
void |
removeSelection(IlpArea area)
Removes an
IlpArea from the selection. |
void |
removeSelection(IlpRepresentationObject object,
IlpAttribute attribute)
Removes an attribute for a representation object from the selection.
|
void |
removeSelectionListener(TableSelectionListener listener)
Removes a listener to object selection events.
|
void |
removeSelectionObject(IlpObject object)
Removes the given
IlpObject from the selection. |
void |
removeSelectionRepresentationObject(IlpRepresentationObject object)
Removes the given
IlpRepresentationObject from the
selection. |
void |
removeSelectionRepresentationObjects(Collection ros)
Removes the given
IlpRepresentationObject s from
the selection. |
void |
setAdjusting(boolean adjusting)
Indicates that the selection model will be changed.
|
void |
setAnchor(IlpRepresentationObject object,
IlpAttribute attribute)
Sets the cell (that is, the attribute of the representation object)
that has the focus in the table.
|
void |
setLeadSelection(IlpArea newLeadSelection)
Sets the
IlpArea composing the temporary lead selection. |
void |
setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
Sets the
IlpRepresentationObjectMapper which will
be used to know the IlpRepresentationObject
associated to an IlpObject . |
void |
setSelectedObject(IlpObject object)
Sets the selected
IlpObject . |
void |
setSelectedObjects(Collection objects)
Sets the set of selected
IlpObject s. |
void |
setSelectedRepresentationObject(IlpRepresentationObject object)
Sets the selected
IlpRepresentationObject . |
void |
setSelectedRepresentationObjects(Collection selected)
Sets the set of selected
IlpRepresentationObject s. |
void |
setSelection(IlpArea newSelection)
Applies a new selection.
|
void |
setSelection(IlpRepresentationObject object,
IlpAttribute attribute)
Applies a new selection.
|
void |
setSelectionMode(IlpTableSelectionMode selectionMode)
Sets the selection mode.
|
public IlpDefaultTableSelectionModel()
public IlpDefaultTableSelectionModel(IlpTableSelectionMode selectionMode)
selectionMode
- Selection modepublic void setSelectionMode(IlpTableSelectionMode selectionMode)
IlpTableResizeMode
for possible values.selectionMode
- The Selection mode to set.IllegalArgumentException
- if the given selection mode is
null
.getSelectionMode()
,
IlpTableSelectionMode
public IlpTableSelectionMode getSelectionMode()
public void setSelection(IlpRepresentationObject object, IlpAttribute attribute)
setSelection
in interface IlpTableSelectionModel
object
- The representation object whose attribute will be selected;
the entire row of the given representation object is selected if
the given attribute equals null
.attribute
- The attribute which will be selected for the given
representation object;
the entire column of the given attribute is selected if
the given representation object equals null
.public void setSelection(IlpArea newSelection)
setSelection
in interface IlpTableSelectionModel
newSelection
- The area which will become the new selection;
if this parameter equals null
, the selection will be cleared.public Collection getSelection()
IlpArea
s composing the selection.getSelection
in interface IlpTableSelectionModel
IlpArea
s;
returns an empty collection when there is no selected area.public void setLeadSelection(IlpArea newLeadSelection)
IlpArea
composing the temporary lead selection.setLeadSelection
in interface IlpTableSelectionModel
newLeadSelection
- The IlpArea
composing the lead selection;
if this parameter equals null
, the lead selection will be
removed.public IlpArea getLeadSelection()
IlpArea
composing the temporary lead selection.getLeadSelection
in interface IlpTableSelectionModel
IlpArea
composing the lead selection;
returns null
if there is no lead selection.public void addSelection(IlpRepresentationObject object, IlpAttribute attribute)
addSelection
in interface IlpTableSelectionModel
object
- The representation object whose attribute will added to the
selection;
the entire row of the given representation object is selected if
the given attribute equals null
.attribute
- The attribute which will be added to the selection
for the given representation object;
the entire column of the given attribute is selected if
the given representation object equals null
.public void addSelection(IlpArea area)
IlpArea
to the selection.
This implementation does nothing.addSelection
in interface IlpTableSelectionModel
area
- The area which will be added to the current selection;
if this parameter equals null
, the selection will be cleared.public void removeSelection(IlpRepresentationObject object, IlpAttribute attribute)
removeSelection
in interface IlpTableSelectionModel
object
- The representation object whose attribute will removed
from the selection;
the entire row of the given representation object is deselected if
the given attribute equals null
.attribute
- The attribute which will be removed from the selection
for the given representation object;
the entire column of the given attribute is deselected if
the given representation object equals null
.public void removeSelection(IlpArea area)
IlpArea
from the selection.removeSelection
in interface IlpTableSelectionModel
area
- The area which will removed from the current selection;
if this parameter equals null
, the method has no effect.public void clearSelection()
clearSelection
in interface IlpTableSelectionModel
clearSelection
in interface IlpObjectSelectionModel
clearSelection
in interface IlpRepresentationObjectSelectionModel
public boolean isSelected(IlpRepresentationObject object, IlpAttribute attribute)
isSelected
in interface IlpTableSelectionModel
object
- The representation object whose attribute is selected or not.attribute
- The attribute which is selected or not for
the given representation object.true
if the cell displaying the given attribute
for the given representation object is selected.public boolean isSelected(IlpArea area)
IlpArea
is selected.isSelected
in interface IlpTableSelectionModel
area
- The area concerned.true
if the cell displaying the given attribute
for the given representation object is selected.public void setAnchor(IlpRepresentationObject object, IlpAttribute attribute)
setAnchor
in interface IlpTableSelectionModel
object
- The representation object that currently has the focus;
may be null
.attribute
- The attribute that currently has the focus;
may be null
.public IlpRepresentationObject getAnchorObject()
getAnchorObject
in interface IlpTableSelectionModel
null
.public IlpAttribute getAnchorAttribute()
getAnchorAttribute
in interface IlpTableSelectionModel
null
.public boolean isAdjusting()
IlpTableSelectionModel
true
if changes are being performed in
the selection model.isAdjusting
in interface IlpTableSelectionModel
public void setAdjusting(boolean adjusting)
IlpTableSelectionModel
setAdjusting
in interface IlpTableSelectionModel
adjusting
- Flag indicating if changes are being
performed or not in the selection model.public void addSelectionListener(TableSelectionListener listener)
addSelectionListener
in interface IlpTableSelectionModel
listener
- The listener to be registered.public void removeSelectionListener(TableSelectionListener listener)
removeSelectionListener
in interface IlpTableSelectionModel
listener
- The listener to be removed.public IlpObject getSelectedObject()
IlpObject
from the collection of selected objects.
Returns null
if there is no selected object.getSelectedObject
in interface IlpObjectSelectionModel
public Collection getSelectedObjects()
IlpObject
s.
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 IlpObjectSelectionModel
IlpObject
s.public boolean isObjectSelected(IlpObject object)
isObjectSelected
in interface IlpObjectSelectionModel
object
- 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 IlpObjectSelectionModel
object
- 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 IlpObjectSelectionModel
object
- The object that will be removed from the selection.public void setSelectedObject(IlpObject object)
IlpObject
.
This has no effect if the given object is already selected.setSelectedObject
in interface IlpObjectSelectionModel
object
- The object that will become the selection.public void setSelectedObjects(Collection objects)
IlpObject
s.setSelectedObjects
in interface IlpObjectSelectionModel
objects
- The collection of objects that will become the selection.public IlpRepresentationObject getSelectedRepresentationObject()
IlpRepresentationObject
from the collection of selected representation objects.
Returns null
if there is no selected object.getSelectedRepresentationObject
in interface IlpRepresentationObjectSelectionModel
null
if
the selection is empty.public Collection getSelectedRepresentationObjects()
IlpRepresentationObject
s.
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.getSelectedRepresentationObjects
in interface IlpRepresentationObjectSelectionModel
IlpRepresentationObject
spublic boolean isRepresentationObjectSelected(IlpRepresentationObject object)
isRepresentationObjectSelected
in interface IlpRepresentationObjectSelectionModel
object
- The representation object which may be selected.public void addSelectionRepresentationObject(IlpRepresentationObject object)
IlpRepresentationObject
to the
selection.
This has no effect if the given object is null
.addSelectionRepresentationObject
in interface IlpRepresentationObjectSelectionModel
object
- The representation object that will be added to the
selection.public void removeSelectionRepresentationObject(IlpRepresentationObject object)
IlpRepresentationObject
from the
selection.
This has no effect if the given object is null
.removeSelectionRepresentationObject
in interface IlpRepresentationObjectSelectionModel
object
- The representation object that will be removed from the
selection.public void removeSelectionRepresentationObjects(Collection ros)
IlpRepresentationObject
s from
the selection.
This has no effect if the given objects are null
or if
they are currently unselected.removeSelectionRepresentationObjects
in interface IlpRepresentationObjectSelectionModel
ros
- The collection of representation objects to be removedpublic void setSelectedRepresentationObject(IlpRepresentationObject object)
IlpRepresentationObject
.
This has no effect if the given object is already selected.setSelectedRepresentationObject
in interface IlpRepresentationObjectSelectionModel
object
- The object that will become the selection.public void setSelectedRepresentationObjects(Collection selected)
IlpRepresentationObject
s.
This has no effect if the given object is null
or if
it is already selected.setSelectedRepresentationObjects
in interface IlpRepresentationObjectSelectionModel
selected
- The collection of representation objects that will become the
selection.public void setRepresentationObjectMapper(IlpRepresentationObjectMapper representationObjectMapper)
IlpRepresentationObjectMapper
which will
be used to know the IlpRepresentationObject
associated to an IlpObject
.setRepresentationObjectMapper
in interface IlpTableSelectionModel
representationObjectMapper
- 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 IlpTableSelectionModel
null
.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.