Package: groovy.swing.binding

## [Groovy] Class JListSelectedElementBinding

- groovy.swing.binding.JListSelectedElementBinding

- All Implemented Interfaces and Traits:
    PropertyChangeListener, ListSelectionListener

      class JListSelectedElementBinding
      extends AbstractSyntheticBinding
      implements PropertyChangeListener, ListSelectionListener

  Tracks selection-related synthetic JList properties and forwards updates to a target binding.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractFullBinding` | `converter, reverseConverter, sourceBinding, targetBinding, validator`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `JList` | `boundList`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `protected JListSelectedElementBinding(PropertyBinding source, TargetBinding target, String propertyName)` Creates a binding for a synthetic selection-related property.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `JList` | `getBoundList()` Returns the list currently bound to this synthetic selection binding.
    `` | `void` | `propertyChange(PropertyChangeEvent event)` Updates the target when the list selection model instance changes.
    `` | `void` | `setBoundList(JList boundList)` Sets the list currently bound to this synthetic selection binding.
    `` | `void` | `setTargetBinding(TargetBinding target)` Sets the target binding to receive synthetic selection updates.
    `` | `void` | `syntheticBind()` Starts listening to selection model replacement and selection changes.
    `` | `void` | `syntheticUnbind()` Stops listening to selection model replacement and selection changes.
    `` | `void` | `valueChanged(ListSelectionEvent e)` Updates the target when the list selection changes.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractSyntheticBinding` | `bind, rebind, setSourceBinding, setTargetBinding, syntheticBind, syntheticUnbind, unbind`
    `class AbstractFullBinding` | `getConverter, getReverseConverter, getSourceBinding, getTargetBinding, getValidator, reverseUpdate, setConverter, setReverseConverter, setSourceBinding, setTargetBinding, setValidator, update`

- - ### Property Detail

    - #### JList boundList

  - ### Constructor Detail

    - #### protected JListSelectedElementBinding(PropertyBinding source, TargetBinding target, String propertyName)

      Creates a binding for a synthetic selection-related property.

      Parameters:
        `source` - the source property binding
        `target` - the target binding to update
        `propertyName` - the synthetic property name to expose

  - ### Method Detail

    - #### @Synchronized
      JList getBoundList()

      Returns the list currently bound to this synthetic selection binding.

      Returns:
        the bound list, or `null` when unbound

    - #### void propertyChange(PropertyChangeEvent event)

      Updates the target when the list selection model instance changes.

      Parameters:
        `event` - the property change event

    - #### @Synchronized
      void setBoundList(JList boundList)

      Sets the list currently bound to this synthetic selection binding.

      Parameters:
        `boundList` - the bound list

    - #### void setTargetBinding(TargetBinding target)

      Sets the target binding to receive synthetic selection updates.

      Parameters:
        `target` - the target binding

    - #### @Synchronized
      void syntheticBind()

      Starts listening to selection model replacement and selection changes.

    - #### @Synchronized
      void syntheticUnbind()

      Stops listening to selection model replacement and selection changes.

    - #### void valueChanged(ListSelectionEvent e)

      Updates the target when the list selection changes.

      Parameters:
        `e` - the selection event