public class StateValue extends AbstractValueModel<Boolean> implements ValueModel<Boolean>, ChangeListener
Constructor and Description |
---|
StateValue(State pState)
We wrap a State object as a ValueModel.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Cleanup all resources: disconnect from any input sources (like
other ValueModel's ...), and remove all listeners.
|
State |
getState()
Return the state we wrap.
|
Boolean |
getValue()
Get the current value, during a callback this is the new value.
|
boolean |
isEditable()
Returns true if our backing state is mutable.
|
void |
setValue(Boolean pValue,
boolean pIsSetForced)
Set a new value, this will fire a ChangeEvent if the new value
is different from the old value.
|
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, signalExternalUpdate, stringValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChangeListener, booleanValue, doubleValue, floatValue, getDependents, getName, intValue, isDisposed, isSetForced, longValue, onChangeSend, removeChangeListener, retractInterestsFor, setName, setObjectValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueForced, stringValue
public StateValue(State pState)
pState
- state we wrap, must not be nullIllegalArgumentException
- if pState is nullpublic boolean isEditable()
isEditable
in interface ValueModel<Boolean>
public void dispose()
dispose
in interface ValueModel<Boolean>
dispose
in class AbstractValueModel<Boolean>
public void stateChanged(ChangeEvent pEvent)
stateChanged
in interface ChangeListener
pEvent
- a ChangeEvent objectpublic State getState()
public void setValue(Boolean pValue, boolean pIsSetForced)
setValue
in interface ValueModel<Boolean>
pValue
- the new Boolean value (null is o.k. and interpreted as false)pIsSetForced
- true if a forced setValue should be doneUnsupportedOperationException
- if the State we wrap is not not mutablepublic Boolean getValue()
getValue
in interface ValueModel<Boolean>
Copyright © 2017 Jürgen Zeller (privat). All rights reserved.