org.positronicnet.ui

UiBinder

class UiBinder extends BindingManager[org.positronicnet.ui.SimpleBinding[_, _]]

Class that helps shuffle data between properties of ReflectiveProperties objects and Android user interface widgets. Each widget has a particular type of property that it can handle; a CheckBoxPreference can handle Boolean properties, an EditTextPreference can handle String properties, and so forth.

Actual shuffling is done by calling the show and update methods of a UiBinder, which was builg with this org.positronicnet.ui.PropertyBinder as the argument to its constructor.

Linear Supertypes
BindingManager[org.positronicnet.ui.SimpleBinding[_, _]], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. UiBinder
  2. BindingManager
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new UiBinder ()

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def bind [TWidget <: AnyRef, TData <: AnyRef] (showFunc: (TWidget, TData) ⇒ Unit, updateFunc: (TWidget, TData) ⇒ TData)(implicit arg0: ClassManifest[TWidget]): Unit

    Declare that widgets of type TWidget can be used to directly render or update objects of type TData.

    Declare that widgets of type TWidget can be used to directly render or update objects of type TData. The caller must supply two functions to manage the mechanics of the shuffling: a showFunc to update a TWidget from the state of a TData, and an updateFunc to update a TData into a TWidget.

    TWidget must be a subclass of android.preference.Preference; Views will be supported too, which is why the typechecker doesn't enforce this.

  8. def bindProperties [TWidget, TProp] (readFunc: (TWidget) ⇒ TProp, writeFunc: (TWidget, TProp) ⇒ Unit)(implicit arg0: ClassManifest[TWidget], arg1: ClassManifest[TProp]): Unit

    Declare that widgets of type TWidget can be used to render or set properties of type TProp.

    Declare that widgets of type TWidget can be used to render or set properties of type TProp. The caller must supply two functions to manage the mechanics of the shuffling: a readFunc to get a TProp out of a TWidget, and a writeFunc to put a TProp into a TWidget.

    TWidget must be a subclass of android.preference.Preference; or android.view.View.

    The default behavior is specified as follows; declarations for other types may be specified similarly, often in a subclass constructor:

        bindProperties[ EditTextPreference, String ](
          (_.getText), (_.setText( _ )))
    
        bindProperties[ CheckBoxPreference, Boolean ](
          (_.isChecked), (_.setChecked( _ )))
    
        bindProperties[ TextView, String ](
          (_.getText.toString), (_.setText( _ )))
    
        bindProperties[ CheckBox, Boolean ](
          (_.isChecked), (_.setChecked( _ )))
    
  9. var bindingMap : Map[Class[_], org.positronicnet.ui.SimpleBinding[_, _]]

    Attributes
    protected
    Definition Classes
    BindingManager
  10. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def getBinder (widget: AnyRef, target: AnyRef): Option[UiBinding]

    Get Some of a UiBinder that can be used to mediate between 'widget' and 'object' (or some appropriately chosen property), or none.

    Get Some of a UiBinder that can be used to mediate between 'widget' and 'object' (or some appropriately chosen property), or none.

    Attributes
    protected
  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef
  16. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  17. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  18. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  19. def noteBinding (klass: Class[_], binder: org.positronicnet.ui.SimpleBinding[_, _], kind: String): Unit

    Attributes
    protected
    Definition Classes
    BindingManager
  20. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  21. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  22. def show (toShow: AnyRef, view: View): Unit

    Update an Android View (or ViewGroup) based on the properties of the object toShow.

    Update an Android View (or ViewGroup) based on the properties of the object toShow.

    A ViewGroup is handled by iterating over its members. (If those contain nested ViewGroups, we iterate over their members too.) Otherwise, we proceed as follows:

    If a binder has been declared for the particular View type and the class of toShow (q.v. bind), then it is used to handle the data transfer. Otherwise, if the View has been bound to a particular property type with bindProperties, and if toShow is a org.postronicnet.util.ReflectiveProperties object, we attempt to get the name corresponding to the view's ID (viz. org.positronicnet.ui.ResourceId), and look for an appropriate property of that name.

    XXX not working:

    If we can't find any relevant declared UI Binding, and the supplied view is a TextView, we effectively do view.setText(toShow.toString). A TextView that is the child of a supplied ViewGroup does not get this treatment, to leave labels and the like in a complex layout of some kind undisturbed. Note that unlike for preferences, a child View with no binder declared will just be ignored.

  23. def show (toShow: AnyRef, pref: Preference): Unit

    Update an Android Preference (or PreferenceGroup) based on the properties of the object toShow.

    Update an Android Preference (or PreferenceGroup) based on the properties of the object toShow.

    A PreferenceGroup is handled by iterating over its members. (If those contain nested PreferenceGroups, we iterate over their members too.) Otherwise, we proceed as follows:

    If a binder has been declared for the particular Preference type and the class of toShow (q.v. bind), then it is used to handle the data transfer. Otherwise, if the Preference has been bound to a particular property type with bindProperties, and if toShow is a org.postronicnet.util.ReflectiveProperties object, we look for a property of that type named by the Preference's key (viz. getKey).

    Otherwise, if we can't find a relevant declared UI Binding, a NoBinderFor exception is thrown at runtime.

  24. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  25. def toString (): String

    Definition Classes
    AnyRef → Any
  26. def update [T <: AnyRef] (toUpdate: T, view: View): T

    Use an Android View (or ViewGroup) to produce an updated version of the ReflectiveProperties object toUpdate.

    Use an Android View (or ViewGroup) to produce an updated version of the ReflectiveProperties object toUpdate.

    A ViewGroup is handled by iterating over its members. (If those contain nested ViewGroups, we iterate over their members too.) Otherwise, we proceed as follows:

    If a binder has been declared for the particular View type and the class of toShow (q.v. bind), then it is used to handle the data transfer. Otherwise, if the View has been bound to a particular property type with bindProperties, and if toShow is a org.postronicnet.util.ReflectiveProperties object, we look for a property of that type named by the View's key (viz. getKey).

    Properties not named by any View are left unaltered.

  27. def update [T <: AnyRef] (toUpdate: T, pref: Preference): T

    Use an Android Preference (or PreferenceGroup) to produce an updated version of the ReflectiveProperties object toUpdate.

    Use an Android Preference (or PreferenceGroup) to produce an updated version of the ReflectiveProperties object toUpdate.

    A PreferenceGroup is handled by iterating over its members. (If those contain nested PreferenceGroups, we iterate over their members too.) Otherwise, we proceed as follows:

    If a binder has been declared for the particular Preference type and the class of toShow (q.v. bind), then it is used to handle the data transfer. Otherwise, if the Preference has been bound to a particular property type with bindProperties, and if toShow is a org.postronicnet.util.ReflectiveProperties object, we look for a property of that type named by the Preference's key (viz. getKey).

    Properties not named by any Preference are left unaltered.

  28. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  30. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from BindingManager[org.positronicnet.ui.SimpleBinding[_, _]]

Inherited from AnyRef

Inherited from Any