Package org.apache.groovy.swing.binding
Class AbstractFullBinding
java.lang.Object
org.apache.groovy.swing.binding.AbstractFullBinding
- All Implemented Interfaces:
BindingUpdatable,FullBinding
- Direct Known Subclasses:
AbstractSyntheticBinding,PropertyPathFullBinding
Base implementation for
FullBinding that handles validation and value conversion.- Since:
- Groovy 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClosureOptional converter applied before writing to the target.protected ClosureOptional converter applied before writing back to the source.protected SourceBindingThe source side of the binding.protected TargetBindingThe target side of the binding.protected ClosureOptional validator invoked before forward propagation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the forward converter.Returns the reverse converter.Returns the current source binding.Returns the current target binding.Returns the validator invoked before forward propagation.voidPropagates the current target value back to the source.voidsetConverter(Closure converter) Sets the forward converter.voidsetReverseConverter(Closure reverseConverter) Sets the reverse converter.voidsetSourceBinding(SourceBinding sourceBinding) Replaces the current source binding.voidsetTargetBinding(TargetBinding targetBinding) Replaces the current target binding.voidsetValidator(Closure validator) Sets the validator invoked before forward propagation.voidupdate()Propagates the current source value to the target.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.groovy.swing.binding.BindingUpdatable
bind, rebind, unbind
-
Field Details
-
sourceBinding
The source side of the binding. -
targetBinding
The target side of the binding. -
validator
Optional validator invoked before forward propagation. -
converter
Optional converter applied before writing to the target. -
reverseConverter
Optional converter applied before writing back to the source.
-
-
Constructor Details
-
AbstractFullBinding
public AbstractFullBinding()
-
-
Method Details
-
update
public void update()Propagates the current source value to the target.- Specified by:
updatein interfaceBindingUpdatable
-
reverseUpdate
public void reverseUpdate()Propagates the current target value back to the source.- Specified by:
reverseUpdatein interfaceBindingUpdatable
-
getSourceBinding
Returns the current source binding.- Specified by:
getSourceBindingin interfaceFullBinding- Returns:
- the source binding
-
setSourceBinding
Replaces the current source binding.- Specified by:
setSourceBindingin interfaceFullBinding- Parameters:
sourceBinding- the new source binding
-
getTargetBinding
Returns the current target binding.- Specified by:
getTargetBindingin interfaceFullBinding- Returns:
- the target binding
-
setTargetBinding
Replaces the current target binding.- Specified by:
setTargetBindingin interfaceFullBinding- Parameters:
targetBinding- the new target binding
-
getValidator
Returns the validator invoked before forward propagation.- Specified by:
getValidatorin interfaceFullBinding- Returns:
- the validator closure, or
null
-
setValidator
Sets the validator invoked before forward propagation.- Specified by:
setValidatorin interfaceFullBinding- Parameters:
validator- the validator closure, ornull
-
getConverter
Returns the forward converter.- Specified by:
getConverterin interfaceFullBinding- Returns:
- the converter closure, or
null
-
setConverter
Sets the forward converter.- Specified by:
setConverterin interfaceFullBinding- Parameters:
converter- the converter closure, ornull
-
getReverseConverter
Returns the reverse converter.- Specified by:
getReverseConverterin interfaceFullBinding- Returns:
- the reverse converter, or
null
-
setReverseConverter
Sets the reverse converter.- Specified by:
setReverseConverterin interfaceFullBinding- Parameters:
reverseConverter- the reverse converter, ornull
-