Class SimpleValueProperty<S,T>

java.lang.Object
org.eclipse.core.databinding.property.value.ValueProperty<S,T>
org.eclipse.core.databinding.property.value.SimpleValueProperty<S,T>
Type Parameters:
S - type of the source object
T - type of the value of the property
All Implemented Interfaces:
IProperty, IValueProperty<S,T>
Direct Known Subclasses:
ViewerValueProperty, WidgetValueProperty

public abstract class SimpleValueProperty<S,T> extends ValueProperty<S,T>
Simplified abstract implementation of IValueProperty. This class takes care of most of the functional requirements for an IValueProperty implementation, leaving only the property-specific details to subclasses.

Subclasses must implement these methods:

In addition, we recommended overriding Object.toString() to return a description suitable for debugging purposes.

Since:
1.2
  • Constructor Details

    • SimpleValueProperty

      public SimpleValueProperty()
  • Method Details

    • doGetValue

      protected abstract T doGetValue(S source)
      Description copied from class: ValueProperty
      Returns the value of the property on the specified source object
      Overrides:
      doGetValue in class ValueProperty<S,T>
      Parameters:
      source - the property source
      Returns:
      the current value of the source's value property
    • doSetValue

      protected abstract void doSetValue(S source, T value)
      Description copied from class: ValueProperty
      Sets the source's value property to the specified vlaue
      Overrides:
      doSetValue in class ValueProperty<S,T>
      Parameters:
      source - the property source
      value - the new value
    • adaptListener

      public abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S,ValueDiff<? extends T>> listener)
      Returns a listener capable of adding or removing itself as a listener on a source object using the the source's "native" listener API. Events received from the source objects are parlayed to the specified listener argument.

      This method returns null if the source object has no listener APIs for this property.

      Parameters:
      listener - the property listener to receive events
      Returns:
      a native listener which parlays property change events to the specified listener, or null if the source object has no listener APIs for this property.
      Restriction:
      This method is not intended to be referenced by clients.
    • observe

      public IObservableValue<T> observe(Realm realm, S source)
      Description copied from interface: IValueProperty
      Returns an observable value observing this value property on the given property source
      Parameters:
      realm - the observable's realm
      source - the property source
      Returns:
      an observable value observing this value property on the given property source
    • observeDetail

      public <U extends S> IObservableList<T> observeDetail(IObservableList<U> master)
      Description copied from interface: IValueProperty
      Returns an observable list on the master observable's realm which tracks this property on each element of master.
      Specified by:
      observeDetail in interface IValueProperty<S,T>
      Overrides:
      observeDetail in class ValueProperty<S,T>
      Parameters:
      master - the master observable
      Returns:
      an observable list which tracks this property on each element of the master observable.
    • observeDetail

      public <U extends S> IObservableMap<U,T> observeDetail(IObservableSet<U> master)
      Description copied from interface: IValueProperty
      Returns an observable map on the master observable's realm where the map's key set is the specified master set, and where each key maps to the current property value for each element.
      Specified by:
      observeDetail in interface IValueProperty<S,T>
      Overrides:
      observeDetail in class ValueProperty<S,T>
      Parameters:
      master - the master observable
      Returns:
      an observable map that tracks the current value of this property for the elements in the given set.
    • observeDetail

      public <K, V extends S> IObservableMap<K,T> observeDetail(IObservableMap<K,V> master)
      Description copied from interface: IValueProperty
      Returns an observable map on the master observable's realm where the map's key set is the same as the master observable map, and where each value is the property value of the corresponding value in the master observable map.
      Specified by:
      observeDetail in interface IValueProperty<S,T>
      Overrides:
      observeDetail in class ValueProperty<S,T>
      Parameters:
      master - the master observable
      Returns:
      an observable map on the master observable's realm which tracks the current value of this property for the elements in the given map's values collection