public class IlpDefaultTableSelectionModel extends Object implements IlpTableSelectionModel
IlpRepresentationObjects.
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
IlpObjects. |
IlpRepresentationObject |
getSelectedRepresentationObject()
Returns the first selected
IlpRepresentationObject
from the collection of selected representation objects. |
Collection |
getSelectedRepresentationObjects()
Returns the set of selected
IlpRepresentationObjects. |
Collection |
getSelection()
Retrieves the collection of
IlpAreas 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
IlpRepresentationObjects 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
IlpObjects. |
void |
setSelectedRepresentationObject(IlpRepresentationObject object)
Sets the selected
IlpRepresentationObject. |
void |
setSelectedRepresentationObjects(Collection selected)
Sets the set of selected
IlpRepresentationObjects. |
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(),
IlpTableSelectionModepublic IlpTableSelectionMode getSelectionMode()
public void setSelection(IlpRepresentationObject object, IlpAttribute attribute)
setSelection in interface IlpTableSelectionModelobject - 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 IlpTableSelectionModelnewSelection - The area which will become the new selection;
if this parameter equals null, the selection will be cleared.public Collection getSelection()
IlpAreas composing the selection.getSelection in interface IlpTableSelectionModelIlpAreas;
returns an empty collection when there is no selected area.public void setLeadSelection(IlpArea newLeadSelection)
IlpArea composing the temporary lead selection.setLeadSelection in interface IlpTableSelectionModelnewLeadSelection - 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 IlpTableSelectionModelIlpArea composing the lead selection;
returns null if there is no lead selection.public void addSelection(IlpRepresentationObject object, IlpAttribute attribute)
addSelection in interface IlpTableSelectionModelobject - 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 IlpTableSelectionModelarea - 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 IlpTableSelectionModelobject - 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 IlpTableSelectionModelarea - 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 IlpTableSelectionModelclearSelection in interface IlpObjectSelectionModelclearSelection in interface IlpRepresentationObjectSelectionModelpublic boolean isSelected(IlpRepresentationObject object, IlpAttribute attribute)
isSelected in interface IlpTableSelectionModelobject - 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 IlpTableSelectionModelarea - 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 IlpTableSelectionModelobject - 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 IlpTableSelectionModelnull.public IlpAttribute getAnchorAttribute()
getAnchorAttribute in interface IlpTableSelectionModelnull.public boolean isAdjusting()
IlpTableSelectionModeltrue if changes are being performed in
the selection model.isAdjusting in interface IlpTableSelectionModelpublic void setAdjusting(boolean adjusting)
IlpTableSelectionModelsetAdjusting in interface IlpTableSelectionModeladjusting - Flag indicating if changes are being
performed or not in the selection model.public void addSelectionListener(TableSelectionListener listener)
addSelectionListener in interface IlpTableSelectionModellistener - The listener to be registered.public void removeSelectionListener(TableSelectionListener listener)
removeSelectionListener in interface IlpTableSelectionModellistener - 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 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 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 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 IlpRepresentationObject getSelectedRepresentationObject()
IlpRepresentationObject
from the collection of selected representation objects.
Returns null if there is no selected object.getSelectedRepresentationObject in interface IlpRepresentationObjectSelectionModelnull if
the selection is empty.public Collection getSelectedRepresentationObjects()
IlpRepresentationObjects.
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 IlpRepresentationObjectSelectionModelIlpRepresentationObjectspublic boolean isRepresentationObjectSelected(IlpRepresentationObject object)
isRepresentationObjectSelected in interface IlpRepresentationObjectSelectionModelobject - 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 IlpRepresentationObjectSelectionModelobject - 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 IlpRepresentationObjectSelectionModelobject - The representation object that will be removed from the
selection.public void removeSelectionRepresentationObjects(Collection ros)
IlpRepresentationObjects from
the selection.
This has no effect if the given objects are null or if
they are currently unselected.removeSelectionRepresentationObjects in interface IlpRepresentationObjectSelectionModelros - 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 IlpRepresentationObjectSelectionModelobject - The object that will become the selection.public void setSelectedRepresentationObjects(Collection selected)
IlpRepresentationObjects.
This has no effect if the given object is null or if
it is already selected.setSelectedRepresentationObjects in interface IlpRepresentationObjectSelectionModelselected - 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 IlpTableSelectionModelrepresentationObjectMapper - 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 IlpTableSelectionModelnull.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.