Package groovy.swing.model
Class ClosureModel
java.lang.Object
groovy.swing.model.ClosureModel
- All Implemented Interfaces:
NestedValueModel,ValueModel
public class ClosureModel extends java.lang.Object implements ValueModel, NestedValueModel
Represents a value model using a closure to extract
the value from some source model and an optional write closure
for updating the value.
-
Constructor Summary
Constructors Constructor Description ClosureModel(ValueModel sourceModel, Closure readClosure)ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure)ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure, java.lang.Class type) -
Method Summary
Modifier and Type Method Description ValueModelgetSourceModel()java.lang.ClassgetType()java.lang.ObjectgetValue()booleanisEditable()voidsetValue(java.lang.Object value)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ClosureModel
-
ClosureModel
-
ClosureModel
public ClosureModel(ValueModel sourceModel, Closure readClosure, Closure writeClosure, java.lang.Class type)
-
-
Method Details
-
getSourceModel
- Specified by:
getSourceModelin interfaceNestedValueModel
-
getValue
public java.lang.Object getValue()- Specified by:
getValuein interfaceValueModel
-
setValue
public void setValue(java.lang.Object value)- Specified by:
setValuein interfaceValueModel
-
getType
public java.lang.Class getType()- Specified by:
getTypein interfaceValueModel
-
isEditable
public boolean isEditable()- Specified by:
isEditablein interfaceValueModel
-