public class SelectionModel extends VersionedSet<java.lang.Integer>
Modifier and Type | Class and Description |
---|---|
static class |
SelectionModel.SelectionMode |
Constructor and Description |
---|
SelectionModel() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.lang.Integer selection) |
com.simsilica.lemur.core.VersionedReference<java.lang.Integer> |
createSelectionReference()
For single-selections, this will hold the currently selected value.
|
java.lang.Integer |
getSelection()
Returns the single selection if there is only one
selected item or null if there is no selection or
more than one item is selected.
|
SelectionModel.SelectionMode |
getSelectionMode() |
protected void |
incrementVersion() |
void |
setSelection(java.lang.Integer selection)
Sets the currently selected single value regardless
of selection mode.
|
void |
setSelectionMode(SelectionModel.SelectionMode mode) |
protected void |
updateSelected() |
createReference, getObject, getVersion, iterator, size
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public com.simsilica.lemur.core.VersionedReference<java.lang.Integer> createSelectionReference()
public void setSelectionMode(SelectionModel.SelectionMode mode)
public SelectionModel.SelectionMode getSelectionMode()
public java.lang.Integer getSelection()
public void setSelection(java.lang.Integer selection)
public boolean add(java.lang.Integer selection)
add
in interface java.util.Collection<java.lang.Integer>
add
in interface java.util.Set<java.lang.Integer>
add
in class VersionedSet<java.lang.Integer>
protected void incrementVersion()
incrementVersion
in class VersionedSet<java.lang.Integer>
protected void updateSelected()