T - the type inside the listpublic class IndexedAdapter<T> extends AbstractValueModel<T> implements ValueModel<T>, ExternalUpdate, ChangeListener
| Constructor and Description |
|---|
IndexedAdapter(List<T> pSource)
Creates a new IndexedAdapter that does not select an entry in the list.
|
IndexedAdapter(List<T> pSource,
int pIndex)
Creates a new IndexedAdapter.
|
IndexedAdapter(ValueModel<List<T>> pTrigger)
Creates a new IndexedAdapter that does not select an entry in the list.
|
IndexedAdapter(ValueModel<List<T>> pTrigger,
int pIndex)
Creates a new IndexedAdapter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Cleanup all resources: disconnect from any input sources (like
other ValueModel's ...), and remove all listeners.
|
int |
getIndex()
Get the current index.
|
ValueModel<List<T>> |
getTrigger()
Return the Trigger or null if there is no trigger.
|
T |
getValue()
Get the current value, during a callback this is the new value.
|
void |
indexChanged(ChangeEvent pEvent)
Callback from our SelectionInList value model if it's index changed.
|
boolean |
isEditable()
Returns always true
|
ValueModel<Boolean> |
isIndexInList()
The provided ValueModel can be used to monitor if this IndexedAdapter
holds a "valid" value (index is not NO_SELECTION).
|
void |
setIndex(int pIndex)
Set the index, if the index is different from the old index
wie fire a state change.
|
void |
setValue(T pValue,
boolean pIsSetForced)
Set a new value, this will fire a ChangeEvent if the new value
is different from the old value.
|
void |
signalExternalUpdate()
Signal this object that portions of its data changed.
|
void |
stateChanged(ChangeEvent pEvent)
Invoked when the target of the listener has changed its state.
|
addChangeListener, booleanValue, checkDisposed, doubleValue, fireStateChanged, floatValue, getDependents, getName, intValue, isDisposed, isInSetValue, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setInSetValue, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, stringValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, booleanValue, doubleValue, floatValue, getDependents, getName, intValue, isDisposed, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, stringValuepublic IndexedAdapter(ValueModel<List<T>> pTrigger)
pTrigger - the list we are indexing into is the trigger's valueIllegalArgumentException - if pTrigger or pTrigger.getValue() is null or not
a Listpublic IndexedAdapter(ValueModel<List<T>> pTrigger, int pIndex)
pTrigger - the list we are indexing into is the trigger's valuepIndex - NO_SELECTION or the initial index in the listIllegalArgumentException - if pTrigger or pTrigger.getValue() is null or not
a List or pIndex is out of rangepublic IndexedAdapter(List<T> pSource)
pSource - the list we are indexing intoIllegalArgumentException - if pSource is nullpublic IndexedAdapter(List<T> pSource, int pIndex)
pSource - the list we are indexing intopIndex - NO_SELECTION or the initial index in the listIllegalArgumentException - if pSource is null or pIndex is out of rangepublic ValueModel<List<T>> getTrigger()
public boolean isEditable()
isEditable in interface ValueModel<T>public void dispose()
dispose in interface ValueModel<T>dispose in class AbstractValueModel<T>public void setValue(T pValue, boolean pIsSetForced)
setValue in interface ValueModel<T>pValue - the new value (null is o.k.)pIsSetForced - true if a forced setValue should be donepublic T getValue()
getValue in interface ValueModel<T>public void setIndex(int pIndex)
pIndex - the new indexpublic int getIndex()
public void indexChanged(ChangeEvent pEvent)
pEvent - not usedpublic ValueModel<Boolean> isIndexInList()
public void signalExternalUpdate()
signalExternalUpdate in interface ExternalUpdatesignalExternalUpdate in class AbstractValueModel<T>public void stateChanged(ChangeEvent pEvent)
stateChanged in interface ChangeListenerpEvent - a ChangeEvent objectCopyright © 2017 Jürgen Zeller (privat). All rights reserved.