Package: org.apache.groovy.swing.binding

## [Java] Class ClosureSourceBinding

- org.apache.groovy.swing.binding.ClosureSourceBinding

- All Implemented Interfaces and Traits:
    SourceBinding

      public class ClosureSourceBinding
      extends Object
      implements SourceBinding

  Uses a closure invocation to compute a source value for a binding.

  Since:
    Groovy 1.1

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ClosureSourceBinding(Closure closure)` Creates a source binding that invokes the closure with no arguments.
    `ClosureSourceBinding(Closure closure, Object[] arguments)` Creates a source binding that invokes the closure with the supplied arguments.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Closure` | `getClosure()` Returns the closure used to compute source values.
    `` | `public Object` | `getSourceValue()` Invokes the configured closure with the current argument list.
    `` | `public void` | `setClosure(Closure closure)` Replaces the closure used to compute source values.
    `` | `public void` | `setClosureArgument(Object argument)` Replaces the closure arguments with a single argument.
    `` | `public void` | `setClosureArguments(Object[] arguments)` Replaces the full argument list passed to the closure.

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### public ClosureSourceBinding(Closure closure)

      Creates a source binding that invokes the closure with no arguments.

      Parameters:
        `closure` - the closure used to compute source values

    - #### public ClosureSourceBinding(Closure closure, Object[] arguments)

      Creates a source binding that invokes the closure with the supplied arguments.

      Parameters:
        `closure` - the closure used to compute source values
        `arguments` - the closure arguments to supply

  - ### Method Detail

    - #### public Closure getClosure()

      Returns the closure used to compute source values.

      Returns:
        the source closure

    - #### public Object getSourceValue()

      Invokes the configured closure with the current argument list.

      Returns:
        the computed source value

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

      Replaces the closure used to compute source values.

      Parameters:
        `closure` - the new source closure

    - #### public void setClosureArgument(Object argument)

      Replaces the closure arguments with a single argument.

      Parameters:
        `argument` - the single closure argument to use

    - #### public void setClosureArguments(Object[] arguments)

      Replaces the full argument list passed to the closure.

      Parameters:
        `arguments` - the closure arguments to use