public abstract static class UiBinding.ComponentAdapter<PropertyType, ComponentType>

  1. Object
  2. UiBinding.ComponentAdapter

Known subtypesUiBinding.CheckBoxRadioSelectionAdapter, UiBinding.PickerAdapter, UiBinding.RadioListAdapter, UiBinding.TextAreaAdapter, UiBinding.TextComponentAdapter

Adapters can be extended to allow any component to bind to a property via a converter

Fields

protected final UiBinding.ObjectConverter toPropertyTypeUsed by the subclass to convert values from the component to the property
protected final UiBinding.ObjectConverter toComponentTypeUsed by the subclass to convert values from the property to the component

Constructors

public ComponentAdapter(UiBinding.ObjectConverter toPropertyType, UiBinding.ObjectConverter toComponentType)Subclasses usually provide the toComponentType and allow their callers to define the toPropertyType

Methods

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

Inherited methods

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 UiBinding.ObjectConverter
Used by the subclass to convert values from the component to the property
toComponentType UiBinding.ObjectConverter
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 PropertyType
the value that was returned from the property get method
cmp ComponentType
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 ComponentType
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 ComponentType
the component
l ActionListener<ActionEvent>
listener

removeListener

public abstract void removeListener(ComponentType cmp, ActionListener<ActionEvent> l)
Removes the action listener from changes in the component

Parameters

cmp ComponentType
the component
l ActionListener<ActionEvent>
listener