Class SimpleSetProperty<S,E>
- java.lang.Object
-
- org.eclipse.core.databinding.property.set.SetProperty<S,E>
-
- org.eclipse.core.databinding.property.set.SimpleSetProperty<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:
ViewerSetProperty
public abstract class SimpleSetProperty<S,E> extends SetProperty<S,E>
Simplified abstract implementation of ISetProperty. This class takes care of most of the functional requirements for an ISetProperty implementation, leaving only the property-specific details to subclasses.Subclasses must implement these methods:
-
ISetProperty.getElementType()
-
doGetSet(Object)
-
doSetSet(Object, Set, SetDiff)
-
adaptListener(ISimplePropertyListener)
In addition, we recommended overriding
Object.toString()
to return a description suitable for debugging purposes.- Since:
- 1.2
-
-
Constructor Summary
Constructors Constructor Description SimpleSetProperty()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract INativePropertyListener<S>
adaptListener(ISimplePropertyListener<S,SetDiff<E>> 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.protected abstract 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 abstract void
doSetSet(S source, Set<E> set, SetDiff<E> diff)
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.IObservableSet<E>
observe(Realm realm, S source)
Returns an observable set observing this set property on the given property sourcevoid
setSet(S source, Set<E> set, SetDiff<E> diff)
Updates the property on the source with the specified change.-
Methods inherited from class org.eclipse.core.databinding.property.set.SetProperty
getSet, observe, observeDetail, setFactory, setFactory, setSet, updateSet, values
-
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
-
-
-
-
Method Detail
-
observe
public IObservableSet<E> observe(Realm realm, S source)
Description copied from interface:ISetProperty
Returns an observable set observing this set property on the given property source- Parameters:
realm
- the observable's realmsource
- the property source- Returns:
- an observable set observing this set property on the given property source
-
doGetSet
protected abstract Set<E> doGetSet(S source)
Description copied from class:SetProperty
Returns a Set with the current contents of the source's set property- Overrides:
doGetSet
in classSetProperty<S,E>
- Parameters:
source
- the property source- Returns:
- a Set with the current contents of the source's set property
-
setSet
public final void setSet(S source, Set<E> set, SetDiff<E> diff)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourceset
- the new setdiff
- a diff describing the change- Since:
- 1.6
- Restriction:
- This method is not intended to be referenced by clients.
-
doSetSet
protected abstract void doSetSet(S source, Set<E> set, SetDiff<E> diff)
Updates the property on the source with the specified change.- Parameters:
source
- the property sourceset
- the new setdiff
- a diff describing the change- Restriction:
- This method is not intended to be referenced by clients.
-
doSetSet
protected void doSetSet(S source, Set<E> set)
Description copied from class:SetProperty
Updates the property on the source with the specified change.- Overrides:
doSetSet
in classSetProperty<S,E>
- Parameters:
source
- the property sourceset
- the new set
-
doUpdateSet
protected void doUpdateSet(S source, SetDiff<E> diff)
Description copied from class:SetProperty
Updates the property on the source with the specified change.- Overrides:
doUpdateSet
in classSetProperty<S,E>
- Parameters:
source
- the property sourcediff
- a diff describing the change
-
adaptListener
public abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S,SetDiff<E>> 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.
-
-