S
- type of the source objectT
- type of the value of the propertypublic abstract class ValueProperty<S,T> extends Object implements IValueProperty<S,T>
Constructor and Description |
---|
ValueProperty() |
Modifier and Type | Method and Description |
---|---|
protected T |
doGetValue(S source)
Returns the value of the property on the specified source object
|
protected void |
doSetValue(S source,
T value)
Sets the source's value property to the specified vlaue
|
T |
getValue(S source)
By default, this method returns
null in case the source
object is itself null . |
<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> |
observeDetail(IObservableList<V> master)
Returns an observable list on the master observable's realm which tracks
this property on each element of
master . |
<K,V extends S> |
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> |
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> |
observeDetail(IObservableValue<U> master)
Returns an observable value on the master observable's realm which tracks
this property on the current value of
master . |
<E> ISetProperty<S,E> |
set(ISetProperty<? super T,E> detailSet)
Returns the nested combination of this property and the specified detail
set property.
|
void |
setValue(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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getValueType, observe
public T getValue(S source)
null
in case the source
object is itself null
. Otherwise, this method delegates to
doGetValue(Object)
.
Clients may override this method if they e.g. want to return a specific
default value in case the source object is null
.
getValue
in interface IValueProperty<S,T>
source
- the property source (may be null)doGetValue(Object)
protected T doGetValue(S source)
source
- the property sourcepublic final void setValue(S source, T value)
IValueProperty
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.
setValue
in interface IValueProperty<S,T>
source
- the property source (may be null)value
- the new property valueprotected void doSetValue(S source, T value)
source
- the property sourcevalue
- the new valuepublic IObservableValue<T> observe(S source)
IValueProperty
observe
in interface IValueProperty<S,T>
source
- the property sourcepublic IObservableFactory<S,IObservableValue<T>> valueFactory()
IValueProperty
valueFactory
in interface IValueProperty<S,T>
public IObservableFactory<S,IObservableValue<T>> valueFactory(Realm realm)
IValueProperty
valueFactory
in interface IValueProperty<S,T>
realm
- the realmpublic <U extends S> IObservableValue<T> observeDetail(IObservableValue<U> master)
IValueProperty
master
.observeDetail
in interface IValueProperty<S,T>
master
- the master observablemaster
.public <V extends S> IObservableList<T> observeDetail(IObservableList<V> master)
IValueProperty
master
.observeDetail
in interface IValueProperty<S,T>
master
- the master observablepublic <V extends S> IObservableMap<V,T> observeDetail(IObservableSet<V> master)
IValueProperty
observeDetail
in interface IValueProperty<S,T>
master
- the master observablepublic <K,V extends S> IObservableMap<K,T> observeDetail(IObservableMap<K,V> master)
IValueProperty
observeDetail
in interface IValueProperty<S,T>
master
- the master observablepublic final <U> IValueProperty<S,U> value(IValueProperty<? super T,U> detailValue)
IValueProperty
value
in interface IValueProperty<S,T>
detailValue
- the detail propertypublic final <E> IListProperty<S,E> list(IListProperty<? super T,E> detailList)
IValueProperty
list
in interface IValueProperty<S,T>
detailList
- the detail propertypublic final <E> ISetProperty<S,E> set(ISetProperty<? super T,E> detailSet)
IValueProperty
set
in interface IValueProperty<S,T>
detailSet
- the detail propertypublic final <K,V> IMapProperty<S,K,V> map(IMapProperty<? super T,K,V> detailMap)
IValueProperty
map
in interface IValueProperty<S,T>
detailMap
- the detail property
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.