|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.component.tbl.AbstractSelectionModel<T>
to.etc.domui.component.tbl.KeySelectionModel<T,K>
T
- The instance typeK
- The key typepublic class KeySelectionModel<T,K>
Example implementation of a simple selection model, retaining only the instances key.
Constructor Summary | |
---|---|
KeySelectionModel(boolean multiSelect)
|
|
KeySelectionModel(boolean multiSelect,
boolean retainInstances)
Constructor. |
Method Summary | |
---|---|
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. |
java.util.List<T> |
getSelectedInstances()
|
java.util.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. |
Methods inherited from class to.etc.domui.component.tbl.AbstractSelectionModel |
---|
addListener, callChanged, callSelectionAllChanged, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public 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)
Method Detail |
---|
public boolean isMultiSelect()
ISelectionModel
public boolean isSelected(@Nonnull T rowinstance)
ISelectionModel
public 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()
ISelectionModel
public void setInstanceSelected(@Nonnull T rowinstance, boolean on) throws java.lang.Exception
ISelectionModel
java.lang.Exception
public void clearSelection() throws java.lang.Exception
ISelectionModel
java.lang.Exception
public void selectAll(ITableModel<T> in) throws java.lang.Exception
ISelectionModel
ISelectionAllHandler
,
so that "select all" can be forbidden.
java.lang.Exception
public java.util.List<T> getSelectedInstances()
public java.util.Set<K> getSelectedKeys()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |