Class SetProperty<S,E>
- java.lang.Object
-
- org.eclipse.core.databinding.property.set.SetProperty<S,E>
-
- Type Parameters:
S
- type of the source objectE
- type of the elements in the set
- All Implemented Interfaces:
IProperty
,ISetProperty<S,E>
- Direct Known Subclasses:
DelegatingSetProperty
,SimpleSetProperty
,UnionSetProperty
public abstract class SetProperty<S,E> extends Object implements ISetProperty<S,E>
Abstract implementation of ISetProperty- 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 SetProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<E>
doGetSet(S source)
Returns a Set with the current contents of the source's set propertyprotected void
doSetSet(S source, Set<E> set)
Updates the property on the source with the specified change.protected void
doUpdateSet(S source, SetDiff<E> diff)
Updates the property on the source with the specified change.Set<E>
getSet(S source)
By default, this method returnsCollections.EMPTY_SET
in case the source object isnull
.IObservableSet<E>
observe(S source)
Returns an observable set observing this set property on the given property source<U extends S>
IObservableSet<E>observeDetail(IObservableValue<U> master)
Returns an observable set on the master observable's realm which tracks this property of the current value ofmaster
.IObservableFactory<S,IObservableSet<E>>
setFactory()
Returns a factory for creating observable sets tracking this property of a particular property source.IObservableFactory<S,IObservableSet<E>>
setFactory(Realm realm)
Returns a factory for creating observable sets in the given realm, tracking this property of a particular property source.void
setSet(S source, Set<E> set)
Updates the property on the source with the specified change.void
updateSet(S source, SetDiff<E> diff)
Updates the property on the source with the specified change.<T> IMapProperty<S,E,T>
values(IValueProperty<? super E,T> detailValues)
Returns the nested combination of this property and the specified detail value property.-
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.set.ISetProperty
getElementType, observe
-
-
-
-
Method Detail
-
getSet
public Set<E> getSet(S source)
By default, this method returnsCollections.EMPTY_SET
in case the source object isnull
. Otherwise, this method delegates todoGetSet(Object)
.Clients may override this method if they e.g. want to return a specific default set in case the source object is
null
.- Specified by:
getSet
in interfaceISetProperty<S,E>
- Parameters:
source
- the property source (may be null)- Returns:
- an unmodifiable Set with the current contents of the source's set property
- Since:
- 1.3
- See Also:
doGetSet(Object)
-
doGetSet
protected Set<E> doGetSet(S source)
Returns a Set with the current contents of the source's set property- Parameters:
source
- the property source- Returns:
- a Set with the current contents of the source's set property
- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
setSet
public final void setSet(S source, Set<E> set)
Description copied from interface:ISetProperty
Updates the property on the source with the specified change.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 modify the source through an
IObservableSet
than through the property directly.- Specified by:
setSet
in interfaceISetProperty<S,E>
- Parameters:
source
- the property source (may be null)set
- the new set- Since:
- 1.3
-
doSetSet
protected void doSetSet(S source, Set<E> set)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourceset
- the new set- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
updateSet
public final void updateSet(S source, SetDiff<E> diff)
Description copied from interface:ISetProperty
Updates the property on the source with the specified change.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 modify the source through an
IObservableSet
than through the property directly.- Specified by:
updateSet
in interfaceISetProperty<S,E>
- Parameters:
source
- the property source (may be null)diff
- a diff describing the change- Since:
- 1.3
-
doUpdateSet
protected void doUpdateSet(S source, SetDiff<E> diff)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourcediff
- a diff describing the change- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
observe
public IObservableSet<E> observe(S source)
Description copied from interface:ISetProperty
Returns an observable set observing this set property on the given property source- Specified by:
observe
in interfaceISetProperty<S,E>
- Parameters:
source
- the property source- Returns:
- an observable set observing this set property on the given property source
-
setFactory
public IObservableFactory<S,IObservableSet<E>> setFactory()
Description copied from interface:ISetProperty
Returns a factory for creating observable sets tracking this property of a particular property source.- Specified by:
setFactory
in interfaceISetProperty<S,E>
- Returns:
- a factory for creating observable sets tracking this property of a particular property source.
-
setFactory
public IObservableFactory<S,IObservableSet<E>> setFactory(Realm realm)
Description copied from interface:ISetProperty
Returns a factory for creating observable sets in the given realm, tracking this property of a particular property source.- Specified by:
setFactory
in interfaceISetProperty<S,E>
- Parameters:
realm
- the realm- Returns:
- a factory for creating observable sets in the given realm, tracking this property of a particular property source.
-
observeDetail
public <U extends S> IObservableSet<E> observeDetail(IObservableValue<U> master)
Description copied from interface:ISetProperty
Returns an observable set on the master observable's realm which tracks this property of the current value ofmaster
.- Specified by:
observeDetail
in interfaceISetProperty<S,E>
- Parameters:
master
- the master observable- Returns:
- an observable set on the given realm which tracks this property
of the current value of
master
.
-
values
public final <T> IMapProperty<S,E,T> values(IValueProperty<? super E,T> detailValues)
Description copied from interface:ISetProperty
Returns the nested combination of this property and the specified detail value property. Note that because this property is a projection of value properties over a set, the only modifications supported are through theIObservableMap.put(Object, Object)
andMap.putAll(java.util.Map)
methods. In the latter case, this property does not put entries for keys not already in the master key set. Modifications made through the returned property are delegated to the detail property, using the corresponding set element from the master property as the source.- Specified by:
values
in interfaceISetProperty<S,E>
- Parameters:
detailValues
- the detail property- Returns:
- the nested combination of the master set and detail value properties
-
-