public class InstanceSelectionModel<T> extends AbstractSelectionModel<T> implements Iterable<T>, IAcceptable<T>
| Constructor and Description |
|---|
InstanceSelectionModel(boolean multiSelect) |
InstanceSelectionModel(boolean multiSelect,
IAcceptable<T> acceptable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptable(T value)
Return T to allow an instance to become selected.
|
void |
clearSelection()
Clear all selections, then call the listeners to report the change.
|
T |
getSelected()
Only usable for a non-multiselect, this returns the selected item or null.
|
Set<T> |
getSelectedSet() |
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.
|
Iterator<T> |
iterator() |
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.
|
void |
setSelectedSet(Collection<T> in) |
addListener, callChanged, callSelectionAllChanged, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic InstanceSelectionModel(boolean multiSelect)
public InstanceSelectionModel(boolean multiSelect,
@Nullable
IAcceptable<T> acceptable)
public final boolean isMultiSelect()
ISelectionModelisMultiSelect in interface ISelectionModel<T>public int getSelectionCount()
ISelectionModelgetSelectionCount in interface ISelectionModel<T>public boolean acceptable(@Nonnull T value)
IAcceptableacceptable in interface IAcceptable<T>public boolean isSelected(@Nonnull T rowinstance)
ISelectionModelisSelected in interface ISelectionModel<T>public void setInstanceSelected(@Nonnull T rowinstance, boolean on) throws Exception
ISelectionModelsetInstanceSelected in interface ISelectionModel<T>Exceptionpublic void clearSelection()
throws Exception
ISelectionModelclearSelection in interface ISelectionModel<T>Exceptionpublic void selectAll(ITableModel<T> in) throws Exception
ISelectionModelISelectionAllHandler,
so that "select all" can be forbidden.selectAll in interface ISelectionModel<T>Exception@Nullable public T getSelected()
public void setSelectedSet(@Nonnull Collection<T> in) throws Exception
ExceptionCopyright © 2017 etc.to. All rights reserved.