T
- the data type of records in the listpublic abstract class DefaultSelectionModel<T> extends SelectionModel.AbstractSelectionModel<T>
SelectionModel
that allows items to be selected
according to a subclass-defined rule, plus a list of positive or negative
exceptions.SelectionModel.AbstractSelectionModel<T>
Constructor and Description |
---|
DefaultSelectionModel()
Constructs a DefaultSelectionModel without a key provider.
|
DefaultSelectionModel(ProvidesKey<T> keyProvider)
Constructs a DefaultSelectionModel with the given key provider.
|
Modifier and Type | Method and Description |
---|---|
void |
clearExceptions()
Removes all exceptions.
|
protected void |
fireSelectionChangeEvent()
Fire a
SelectionChangeEvent . |
protected java.util.Map<java.lang.Object,java.lang.Boolean> |
getExceptions(java.util.Map<java.lang.Object,java.lang.Boolean> output)
Copies the exceptions map into a user-supplied map.
|
abstract boolean |
isDefaultSelected(T item)
Returns true if the given item should be selected by default.
|
boolean |
isSelected(T item)
If the given item is marked as an exception, return the exception value.
|
void |
setSelected(T item,
boolean selected)
Sets an item's selection state.
|
addSelectionChangeHandler, fireEvent, getKey, getKeyProvider, isEventCancelled, isEventScheduled, scheduleSelectionChangeEvent, setEventCancelled, setEventScheduled
public DefaultSelectionModel()
public DefaultSelectionModel(ProvidesKey<T> keyProvider)
keyProvider
- an instance of ProvidesKeypublic void clearExceptions()
public abstract boolean isDefaultSelected(T item)
item
- an object of this SelectionModel
's typepublic boolean isSelected(T item)
item
- the objectpublic void setSelected(T item, boolean selected)
item
- the object to select or deselectselected
- true to select, false to deselectprotected void fireSelectionChangeEvent()
SelectionModel.AbstractSelectionModel
SelectionChangeEvent
. Multiple firings may be coalesced.fireSelectionChangeEvent
in class SelectionModel.AbstractSelectionModel<T>
protected java.util.Map<java.lang.Object,java.lang.Boolean> getExceptions(java.util.Map<java.lang.Object,java.lang.Boolean> output)
output
- the user supplied map