Class MutualPropertyBinding

java.lang.Object
org.apache.groovy.swing.binding.MutualPropertyBinding
All Implemented Interfaces:
BindingUpdatable, FullBinding

public class MutualPropertyBinding extends Object implements FullBinding
Maintains two synchronized PropertyBinding instances that update each other.
Since:
Groovy 1.6
  • Method Details

    • getSourceBinding

      public SourceBinding getSourceBinding()
      Returns the forward source-side property binding.
      Specified by:
      getSourceBinding in interface FullBinding
      Returns:
      the source binding
    • getTargetBinding

      public TargetBinding getTargetBinding()
      Returns the forward target-side property binding.
      Specified by:
      getTargetBinding in interface FullBinding
      Returns:
      the target binding
    • setSourceBinding

      public void setSourceBinding(SourceBinding sourceBinding)
      Replaces the source-side property binding and rebuilds the paired bindings.
      Specified by:
      setSourceBinding in interface FullBinding
      Parameters:
      sourceBinding - the new source binding
    • setTargetBinding

      public void setTargetBinding(TargetBinding targetBinding)
      Replaces the target-side property binding and rebuilds the paired bindings.
      Specified by:
      setTargetBinding in interface FullBinding
      Parameters:
      targetBinding - the new target binding
    • setValidator

      public void setValidator(Closure validator)
      Replaces the validator applied to forward updates.
      Specified by:
      setValidator in interface FullBinding
      Parameters:
      validator - the validator closure, or null
    • getValidator

      public Closure getValidator()
      Returns the validator applied to forward updates.
      Specified by:
      getValidator in interface FullBinding
      Returns:
      the validator closure, or null
    • setConverter

      public void setConverter(Closure converter)
      Replaces the converter applied from source to target.
      Specified by:
      setConverter in interface FullBinding
      Parameters:
      converter - the forward converter, or null
    • getConverter

      public Closure getConverter()
      Returns the converter applied from source to target.
      Specified by:
      getConverter in interface FullBinding
      Returns:
      the forward converter, or null
    • setReverseConverter

      public void setReverseConverter(Closure reverseConverter)
      Replaces the converter applied from target to source.
      Specified by:
      setReverseConverter in interface FullBinding
      Parameters:
      reverseConverter - the reverse converter, or null
    • getReverseConverter

      public Closure getReverseConverter()
      Returns the converter applied from target to source.
      Specified by:
      getReverseConverter in interface FullBinding
      Returns:
      the reverse converter, or null
    • rebuildBindings

      protected void rebuildBindings()
      Rebuilds the internal forward and reverse bindings to match the current configuration.
    • bind

      public void bind()
      Binds both forward and reverse bindings when the pair is fully configured.
      Specified by:
      bind in interface BindingUpdatable
    • unbind

      public void unbind()
      Unbinds both forward and reverse bindings.
      Specified by:
      unbind in interface BindingUpdatable
    • rebind

      public void rebind()
      Rebinds both forward and reverse bindings when currently active.
      Specified by:
      rebind in interface BindingUpdatable
    • update

      public void update()
      Pushes an update from the source side to the target side.
      Specified by:
      update in interface BindingUpdatable
    • reverseUpdate

      public void reverseUpdate()
      Pushes an update from the target side back to the source side.
      Specified by:
      reverseUpdate in interface BindingUpdatable