de.matthiasmann.twl.model
Class OptionEnumModel<T extends java.lang.Enum<T>>
java.lang.Object
de.matthiasmann.twl.model.AbstractOptionModel
de.matthiasmann.twl.model.OptionEnumModel<T>
- Type Parameters:
T - The enum class
- All Implemented Interfaces:
- BooleanModel, WithRunnableCallback
public class OptionEnumModel<T extends java.lang.Enum<T>>
- extends AbstractOptionModel
A BooleanModel which is true when the underlying EnumModel has the specified
option code. This can be used for radio/option buttons.
It is not possible to set this BooleanModel to false. It can only be set to
false by setting the underlying EnumModel to another value. Eg by setting
another OptionEnumModel working on the same EnumModel to true.
|
Method Summary |
boolean |
getValue()
|
protected void |
installSrcCallback(java.lang.Runnable cb)
|
protected void |
removeSrcCallback(java.lang.Runnable cb)
|
void |
setValue(boolean value)
If value is true, then the underlying EnumModel is set to the
option code of this OptionEnumModel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptionEnumModel
public OptionEnumModel(EnumModel<T> optionState,
T optionCode)
getValue
public boolean getValue()
setValue
public void setValue(boolean value)
- If value is true, then the underlying EnumModel is set to the
option code of this OptionEnumModel.
if value if false then nothing happens.
- Parameters:
value - the new value of this BooleanModel
installSrcCallback
protected void installSrcCallback(java.lang.Runnable cb)
- Specified by:
installSrcCallback in class AbstractOptionModel
removeSrcCallback
protected void removeSrcCallback(java.lang.Runnable cb)
- Specified by:
removeSrcCallback in class AbstractOptionModel