# Class UiBinding.ComponentAdapter<PropertyType, ComponentType>

java.lang.Object
com.codename1.properties.UiBinding.ComponentAdapter<PropertyType, ComponentType>

Direct Known Subclasses:
  `UiBinding.CheckBoxRadioSelectionAdapter, UiBinding.PickerAdapter, UiBinding.RadioListAdapter, UiBinding.TextAreaAdapter, UiBinding.TextComponentAdapter`

Enclosing class:
  `UiBinding`

public abstract static class UiBinding.ComponentAdapter<PropertyType, ComponentType> extends Object
Adapters can be extended to allow any component to bind to a property via a converter

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final UiBinding.ObjectConverter`
  `toComponentType`
  Used by the subclass to convert values from the property to the component
  `protected final UiBinding.ObjectConverter`
  `toPropertyType`
  Used by the subclass to convert values from the component to the property

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComponentAdapter(UiBinding.ObjectConverter toPropertyType, UiBinding.ObjectConverter toComponentType)`
  Subclasses usually provide the toComponentType and allow their callers to define the toPropertyType

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `assignTo(PropertyType value, ComponentType cmp)`
  Assigns the value from the property into the component
  `abstract void`
  `bindListener(ComponentType cmp, ActionListener<ActionEvent> l)`
  Binds an action listener to changes in the component
  `abstract PropertyType`
  `getFrom(ComponentType cmp)`
  Returns the value for the set method of the property from the given component
  `abstract void`
  `removeListener(ComponentType cmp, ActionListener<ActionEvent> l)`
  Removes the action listener from changes in the component

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### toPropertyType

    protected final UiBinding.ObjectConverter toPropertyType
    Used by the subclass to convert values from the component to the property

  - ### toComponentType

    protected final UiBinding.ObjectConverter toComponentType
    Used by the subclass to convert values from the property to the component

- ## Constructor Details

  - ### ComponentAdapter

    public ComponentAdapter(UiBinding.ObjectConverter toPropertyType, UiBinding.ObjectConverter toComponentType)

    Subclasses usually provide the toComponentType and allow their callers to define the toPropertyType

    ###### Parameters

    - `toPropertyType`: @param toPropertyType Used by the subclass to convert values from the component to the property

    - `toComponentType`: @param toComponentType Used by the subclass to convert values from the property to the component

- ## Method Details

  - ### assignTo

    public abstract void assignTo(PropertyType value, ComponentType cmp)

    Assigns the value from the property into the component

    ###### Parameters

    - `value`: the value that was returned from the property get method

    - `cmp`: the component instance

  - ### getFrom

    public abstract PropertyType getFrom(ComponentType cmp)

    Returns the value for the set method of the property from the given component

    ###### Parameters

    - `cmp`: the component

    ###### Returns

    the value we can place into the set method

  - ### bindListener

    public abstract void bindListener(ComponentType cmp, ActionListener<ActionEvent> l)

    Binds an action listener to changes in the component

    ###### Parameters

    - `cmp`: the component

    - `l`: listener

  - ### removeListener

    public abstract void removeListener(ComponentType cmp, ActionListener<ActionEvent> l)

    Removes the action listener from changes in the component

    ###### Parameters

    - `cmp`: the component

    - `l`: listener