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
    Used by the subclass to convert values from the property to the component
    Used by the subclass to convert values from the component to the property
  • Constructor Summary

    Constructors
    Constructor
    Description
    Subclasses usually provide the toComponentType and allow their callers to define the toPropertyType
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Assigns the value from the property into the component
    abstract void
    Binds an action listener to changes in the component
    abstract PropertyType
    Returns the value for the set method of the property from the given component
    abstract void
    Removes the action listener from changes in the component

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    Modifier and Type
    Method
    Description
    protected Object
     
    boolean
    Indicates whether some other object is "equal to" this one.
    final Class
    Returns the runtime class of an object.
    int
    Returns a hash code value for the object.
    final void
    Wakes up a single thread that is waiting on this object's monitor.
    final void
    Wakes up all threads that are waiting on this object's monitor.
    Returns a string representation of the object.
    final void
    Causes current thread to wait until another thread invokes the method or the method for this object.
    final void
    wait(long timeout)
    Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
    final void
    wait(long timeout, int nanos)
    Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
  • 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