S
- type of the source objectE
- type of the elements in the setpublic abstract class SimpleSetProperty<S,E> extends SetProperty<S,E>
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.
Constructor and Description |
---|
SimpleSetProperty() |
Modifier and Type | Method and 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 property
|
protected 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 source
|
void |
setSet(S source,
Set<E> set,
SetDiff<E> diff)
Updates the property on the source with the specified change.
|
getSet, observe, observeDetail, setFactory, setFactory, setSet, updateSet, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementType
public IObservableSet<E> observe(Realm realm, S source)
ISetProperty
realm
- the observable's realmsource
- the property sourceprotected abstract Set<E> doGetSet(S source)
SetProperty
doGetSet
in class SetProperty<S,E>
source
- the property sourcepublic final void setSet(S source, Set<E> set, SetDiff<E> diff)
source
- the property sourceset
- the new setdiff
- a diff describing the changeprotected abstract void doSetSet(S source, Set<E> set, SetDiff<E> diff)
source
- the property sourceset
- the new setdiff
- a diff describing the changeprotected void doSetSet(S source, Set<E> set)
SetProperty
doSetSet
in class SetProperty<S,E>
source
- the property sourceset
- the new setprotected void doUpdateSet(S source, SetDiff<E> diff)
SetProperty
doUpdateSet
in class SetProperty<S,E>
source
- the property sourcediff
- a diff describing the changepublic abstract INativePropertyListener<S> adaptListener(ISimplePropertyListener<S,SetDiff<E>> listener)
This method returns null if the source object has no listener APIs for this property.
listener
- the property listener to receive events
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.