T - The instance typeK - The key typepublic class KeySelectionModel<T,K> extends AbstractSelectionModel<T>
| Constructor and Description |
|---|
KeySelectionModel(boolean multiSelect) |
KeySelectionModel(boolean multiSelect,
boolean retainInstances)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearSelection()
Clear all selections, then call the listeners to report the change.
|
K |
getKey(T rowinstance)
This must return the unique key K for an instance.
|
List<T> |
getSelectedInstances() |
Set<K> |
getSelectedKeys() |
int |
getSelectionCount()
Return the #of instances currently selected.
|
boolean |
isMultiSelect()
T if this model can handle multiple selections.
|
boolean |
isSelected(T rowinstance)
Return T if this instance is actually selected.
|
void |
selectAll(ITableModel<T> in)
This must add all (recoverable) items in the model and add them as selected as efficiently
as possible.
|
void |
setInstanceSelected(T rowinstance,
boolean on)
Set or clear an instance's selected state.
|
addListener, callChanged, callSelectionAllChanged, removeListenerpublic KeySelectionModel(boolean multiSelect,
boolean retainInstances)
retainInstances - Set T in case that model should collect instancies. For lightweight use, set F in case that collecting PKs is sufficient.public KeySelectionModel(boolean multiSelect)
public boolean isMultiSelect()
ISelectionModelpublic boolean isSelected(@Nonnull T rowinstance)
ISelectionModelpublic K getKey(@Nonnull T rowinstance)
IIdentifyable<K> it will use that to retrieve the key; if that is not possible
you must override this method.rowinstance - public int getSelectionCount()
ISelectionModelpublic void setInstanceSelected(@Nonnull T rowinstance, boolean on) throws Exception
ISelectionModelExceptionpublic void clearSelection()
throws Exception
ISelectionModelExceptionpublic void selectAll(ITableModel<T> in) throws Exception
ISelectionModelISelectionAllHandler,
so that "select all" can be forbidden.ExceptionCopyright © 2017 etc.to. All rights reserved.