Class ValueProperty<S,T>
- java.lang.Object
-
- org.eclipse.core.databinding.property.value.ValueProperty<S,T>
-
- Type Parameters:
S- type of the source objectT- type of the value of the property
- All Implemented Interfaces:
IProperty,IValueProperty<S,T>
- Direct Known Subclasses:
DelegatingValueProperty,SimpleValueProperty
public abstract class ValueProperty<S,T> extends Object implements IValueProperty<S,T>
Abstract implementation of IValueProperty- Since:
- 1.2
- Implementation Note:
- If methods are added to the interface which this class implements then implementations of those methods must be added to this class.
-
-
Constructor Summary
Constructors Constructor Description ValueProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TdoGetValue(S source)Returns the value of the property on the specified source objectprotected voiddoSetValue(S source, T value)Sets the source's value property to the specified vlaueTgetValue(S source)By default, this method returnsnullin case the source object is itselfnull.<E> IListProperty<S,E>list(IListProperty<? super T,E> detailList)Returns the nested combination of this property and the specified detail list property.<K,V>
IMapProperty<S,K,V>map(IMapProperty<? super T,K,V> detailMap)Returns the nested combination of this property and the specified detail map property.IObservableValue<T>observe(S source)Returns an observable value observing this value property on the given property source.<V extends S>
IObservableList<T>observeDetail(IObservableList<V> master)Returns an observable list on the master observable's realm which tracks this property on each element ofmaster.<K,V extends S>
IObservableMap<K,T>observeDetail(IObservableMap<K,V> master)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.<V extends S>
IObservableMap<V,T>observeDetail(IObservableSet<V> master)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.<U extends S>
IObservableValue<T>observeDetail(IObservableValue<U> master)Returns an observable value on the master observable's realm which tracks this property on the current value ofmaster.<E> ISetProperty<S,E>set(ISetProperty<? super T,E> detailSet)Returns the nested combination of this property and the specified detail set property.voidsetValue(S source, T value)Sets this property on the specified property source to the specified value.<U> IValueProperty<S,U>value(IValueProperty<? super T,U> detailValue)Returns the nested combination of this property and the specified detail value property.IObservableFactory<S,IObservableValue<T>>valueFactory()Returns a factory for creating observable values tracking this property of a particular property source.IObservableFactory<S,IObservableValue<T>>valueFactory(Realm realm)Returns a factory for creating observable values in the given realm, tracking this property of a particular property source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.core.databinding.property.value.IValueProperty
getValueType, observe
-
-
-
-
Method Detail
-
getValue
public T getValue(S source)
By default, this method returnsnullin case the source object is itselfnull. Otherwise, this method delegates todoGetValue(Object).Clients may override this method if they e.g. want to return a specific default value in case the source object is
null.- Specified by:
getValuein interfaceIValueProperty<S,T>- Parameters:
source- the property source (may be null)- Returns:
- the current value of this property on the specified property source.
- Since:
- 1.3
- See Also:
doGetValue(Object)
-
doGetValue
protected T doGetValue(S source)
Returns the value of the property on the specified source object- Parameters:
source- the property source- Returns:
- the current value of the source's value property
- Since:
- 1.3
- Restriction:
- This method is not intended to be referenced by clients.
-
setValue
public final void setValue(S source, T value)
Description copied from interface:IValuePropertySets this property on the specified property source to the specified value.Note: This method is made available to facilitate basic property access. However if the property source lacks property change notification, then observables on the source object may not be notified of the change. In most cases it is preferable to call
IObservableValue.setValue(Object)on the observable instead.- Specified by:
setValuein interfaceIValueProperty<S,T>- Parameters:
source- the property source (may be null)value- the new property value- Since:
- 1.3
-
doSetValue
protected void doSetValue(S source, T value)
Sets the source's value property to the specified vlaue- Parameters:
source- the property sourcevalue- the new value- Since:
- 1.3
- Restriction:
- This method is not intended to be referenced by clients.
-
observe
public IObservableValue<T> observe(S source)
Description copied from interface:IValuePropertyReturns an observable value observing this value property on the given property source.- Specified by:
observein interfaceIValueProperty<S,T>- Parameters:
source- the property source- Returns:
- an observable value observing this value property on the given property source
-
valueFactory
public IObservableFactory<S,IObservableValue<T>> valueFactory()
Description copied from interface:IValuePropertyReturns a factory for creating observable values tracking this property of a particular property source.- Specified by:
valueFactoryin interfaceIValueProperty<S,T>- Returns:
- a factory for creating observable values tracking this property of a particular property source.
-
valueFactory
public IObservableFactory<S,IObservableValue<T>> valueFactory(Realm realm)
Description copied from interface:IValuePropertyReturns a factory for creating observable values in the given realm, tracking this property of a particular property source.- Specified by:
valueFactoryin interfaceIValueProperty<S,T>- Parameters:
realm- the realm- Returns:
- a factory for creating observable values in the given realm, tracking this property of a particular property source.
-
observeDetail
public <U extends S> IObservableValue<T> observeDetail(IObservableValue<U> master)
Description copied from interface:IValuePropertyReturns an observable value on the master observable's realm which tracks this property on the current value ofmaster.- Specified by:
observeDetailin interfaceIValueProperty<S,T>- Parameters:
master- the master observable- Returns:
- an observable value which tracks this property of the current
value of
master.
-
observeDetail
public <V extends S> IObservableList<T> observeDetail(IObservableList<V> master)
Description copied from interface:IValuePropertyReturns an observable list on the master observable's realm which tracks this property on each element ofmaster.- Specified by:
observeDetailin interfaceIValueProperty<S,T>- Parameters:
master- the master observable- Returns:
- an observable list which tracks this property on each element of the master observable.
- Since:
- 1.4
-
observeDetail
public <V extends S> IObservableMap<V,T> observeDetail(IObservableSet<V> master)
Description copied from interface:IValuePropertyReturns 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:
observeDetailin interfaceIValueProperty<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.
- Since:
- 1.4
-
observeDetail
public <K,V extends S> IObservableMap<K,T> observeDetail(IObservableMap<K,V> master)
Description copied from interface:IValuePropertyReturns 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:
observeDetailin interfaceIValueProperty<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
- Since:
- 1.4
-
value
public final <U> IValueProperty<S,U> value(IValueProperty<? super T,U> detailValue)
Description copied from interface:IValuePropertyReturns the nested combination of this property and the specified detail value property. Value modifications made through the returned property are delegated to the detail property, using the value of this property as the source.- Specified by:
valuein interfaceIValueProperty<S,T>- Parameters:
detailValue- the detail property- Returns:
- the nested combination of the master and detail properties
-
list
public final <E> IListProperty<S,E> list(IListProperty<? super T,E> detailList)
Description copied from interface:IValuePropertyReturns the nested combination of this property and the specified detail list property. List modifications made through the returned property are delegated to the detail property, using the value of the master property as the source.- Specified by:
listin interfaceIValueProperty<S,T>- Parameters:
detailList- the detail property- Returns:
- the nested combination of the master value and detail list properties
-
set
public final <E> ISetProperty<S,E> set(ISetProperty<? super T,E> detailSet)
Description copied from interface:IValuePropertyReturns the nested combination of this property and the specified detail set property. Set modifications made through the returned property are delegated to the detail property, using the value of the master property as the source.- Specified by:
setin interfaceIValueProperty<S,T>- Parameters:
detailSet- the detail property- Returns:
- the nested combination of the master value and detail set properties
-
map
public final <K,V> IMapProperty<S,K,V> map(IMapProperty<? super T,K,V> detailMap)
Description copied from interface:IValuePropertyReturns the nested combination of this property and the specified detail map property. Map modifications made through the returned property are delegated to the detail property, using the value of the master property as the source.- Specified by:
mapin interfaceIValueProperty<S,T>- Parameters:
detailMap- the detail property- Returns:
- the nested combination of the master value and detial map properties
-
-