Package: org.apache.groovy.swing.binding

## [Java] Class BindingProxy

- org.apache.groovy.swing.binding.BindingProxy

- All Implemented Interfaces and Traits:
    BindingUpdatable

      public class BindingProxy
      extends GroovyObjectSupport
      implements BindingUpdatable

  This class returns half bound FullBindings on the source half to the model object for every property reference (and I do mean every, valid or not, queried before or not). These returned half bindings are stored strongly in a list when generated. Changing the model will keep all existing bindings but change the source on all of the bindings. Formerly Known as Model Binding.

  Since:
    Groovy 1.5

- - ### Constructor Summary

    Constructors
    Constructor and description
    `BindingProxy(Object model)` Creates a proxy for the supplied model object.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `bind()` Binds every generated full binding managed by this proxy.
    `` | `public Object` | `getModel()` Returns the current model object.
    `` | `public Object` | `getProperty(String property)` Lazily creates and returns a half binding for the requested model property.
    `` | `public void` | `rebind()` Rebinds every generated full binding while preserving the current bound state.
    `` | `public void` | `reverseUpdate()` Pushes reverse updates through every generated full binding.
    `` | `public void` | `setModel(Object model)` Replaces the proxied model and retargets all existing property bindings.
    `` | `public void` | `setProperty(String property, Object value)` Prevents direct writes to the proxy.
    `` | `public void` | `unbind()` Unbinds every generated full binding managed by this proxy.
    `` | `public void` | `update()` Pushes updates through every generated full binding.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class GroovyObjectSupport` | `getMetaClass, setMetaClass`

- - ### Constructor Detail

    - #### public BindingProxy(Object model)

      Creates a proxy for the supplied model object.

      Parameters:
        `model` - the model object to expose

  - ### Method Detail

    - #### public void bind()

      Binds every generated full binding managed by this proxy.

    - #### public Object getModel()

      Returns the current model object.

      Returns:
        the current model

    - #### public Object getProperty(String property)

      Lazily creates and returns a half binding for the requested model property.

      Parameters:
        `property` - the property name to bind
      Returns:
        a generated half binding rooted at the requested property

    - #### public void rebind()

      Rebinds every generated full binding while preserving the current bound state.

    - #### public void reverseUpdate()

      Pushes reverse updates through every generated full binding.

    - #### public void setModel(Object model)

      Replaces the proxied model and retargets all existing property bindings.

      Parameters:
        `model` - the new model object

    - #### public void setProperty(String property, Object value)

      Prevents direct writes to the proxy.

      Parameters:
        `property` - the property name being written
        `value` - the attempted value

    - #### public void unbind()

      Unbinds every generated full binding managed by this proxy.

    - #### public void update()

      Pushes updates through every generated full binding.