|
||||||||||
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.InstanceSelectionModel<T>
public class InstanceSelectionModel<T>
This is a selection model that selects simple instances. It allows both single and multiple selections. It collects the selected instances in a set, so the instances should have well-defined equals and hashcode meaning either the Object versions or properly implemented ones.
Constructor Summary | |
---|---|
InstanceSelectionModel(boolean multiSelect)
|
Method Summary | |
---|---|
void |
clearSelection()
Clear all selections, then call the listeners to report the change. |
java.util.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. |
java.util.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. |
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 InstanceSelectionModel(boolean multiSelect)
Method Detail |
---|
public final boolean isMultiSelect()
ISelectionModel
isMultiSelect
in interface ISelectionModel<T>
public int getSelectionCount()
ISelectionModel
getSelectionCount
in interface ISelectionModel<T>
public boolean isSelected(T rowinstance)
ISelectionModel
isSelected
in interface ISelectionModel<T>
public void setInstanceSelected(T rowinstance, boolean on) throws java.lang.Exception
ISelectionModel
setInstanceSelected
in interface ISelectionModel<T>
java.lang.Exception
public void clearSelection() throws java.lang.Exception
ISelectionModel
clearSelection
in interface ISelectionModel<T>
java.lang.Exception
public void selectAll(ITableModel<T> in) throws java.lang.Exception
ISelectionModel
ISelectionAllHandler
,
so that "select all" can be forbidden.
selectAll
in interface ISelectionModel<T>
java.lang.Exception
public java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public java.util.Set<T> getSelectedSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |