Package: org.apache.groovy.swing.binding

## [Java] Class ClosureTriggerBinding

- org.apache.groovy.swing.binding.ClosureTriggerBinding

- All Implemented Interfaces and Traits:
    SourceBinding, TriggerBinding

      public class ClosureTriggerBinding
      extends Object
      implements SourceBinding, TriggerBinding

  Creates bindings that track the property path referenced by a closure expression.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureTriggerBinding(Map<String, TriggerBinding> syntheticBindings)` Creates a closure trigger binding with the supplied synthetic trigger registry.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public FullBinding` | `createBinding(SourceBinding source, TargetBinding target)` Creates a property-path-aware binding by snooping the closure's property accesses.
    `` | `public Closure` | `getClosure()` Returns the closure evaluated by this trigger binding.
    `` | `public Object` | `getSourceValue()` Evaluates the configured closure to obtain the current source value.
    `` | `public void` | `setClosure(Closure closure)` Replaces the closure evaluated by this trigger binding.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ClosureTriggerBinding(Map<String, TriggerBinding> syntheticBindings)

      Creates a closure trigger binding with the supplied synthetic trigger registry.

      Parameters:
        `syntheticBindings` - synthetic trigger bindings keyed by class and property

  - ### Method Detail

    - #### public FullBinding createBinding(SourceBinding source, TargetBinding target)

      Creates a property-path-aware binding by snooping the closure's property accesses.

      Parameters:
        `source` - the source binding, which must be this trigger binding
        `target` - the target binding
      Returns:
        a property-path-aware full binding

    - #### public Closure getClosure()

      Returns the closure evaluated by this trigger binding.

      Returns:
        the source closure

    - #### public Object getSourceValue()

      Evaluates the configured closure to obtain the current source value.

      Returns:
        the current source value

    - #### public void setClosure(Closure closure)

      Replaces the closure evaluated by this trigger binding.

      Parameters:
        `closure` - the new source closure