Class DecoratingObservableSet<E>
java.lang.Object
org.eclipse.core.databinding.observable.AbstractObservable
org.eclipse.core.databinding.observable.DecoratingObservable
org.eclipse.core.databinding.observable.DecoratingObservableCollection<E>
org.eclipse.core.databinding.observable.set.DecoratingObservableSet<E>
- Type Parameters:
E- the type of the elements in this set
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>,IDecoratingObservable,IObservable,IObservableCollection<E>,IObservableSet<E>
public class DecoratingObservableSet<E>
extends DecoratingObservableCollection<E>
implements IObservableSet<E>
An observable set which decorates another observable set.
- 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
ConstructorsConstructorDescriptionDecoratingObservableSet(IObservableSet<E> decorated, boolean disposeDecoratedOnDispose) Constructs a DecoratingObservableSet which decorates the given observable. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddListener(Object listenerType, IObservablesListener listener) voidaddSetChangeListener(ISetChangeListener<? super E> listener) voidclear()protected Objectclone()voiddispose()Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.protected voidprotected voidfireEvent(ObservableEvent event) protected voidfireSetChange(SetDiff<E> diff) protected voidgetRealm()protected voidhandleSetChange(SetChangeEvent<? extends E> event) Called whenever a SetChangeEvent is received from the decorated observable.protected booleanprotected voidprotected voidremoveListener(Object listenerType, IObservablesListener listener) voidremoveSetChangeListener(ISetChangeListener<? super E> listener) Methods inherited from class org.eclipse.core.databinding.observable.DecoratingObservableCollection
add, addAll, contains, containsAll, equals, getElementType, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toStringMethods inherited from class org.eclipse.core.databinding.observable.DecoratingObservable
getDecorated, getterCalled, handleStaleEvent, isStaleMethods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListenerMethods inherited from interface org.eclipse.core.databinding.observable.set.IObservableSet
add, addAll, contains, containsAll, equals, getElementType, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
DecoratingObservableSet
Constructs a DecoratingObservableSet which decorates the given observable.- Parameters:
decorated- the observable set being decorateddisposeDecoratedOnDispose- whether the decorated observable should be disposed when the decorator is disposed
-
-
Method Details
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classDecoratingObservableCollection<E>
-
addSetChangeListener
- Specified by:
addSetChangeListenerin interfaceIObservableSet<E>- Parameters:
listener- the change listener to add; notnull
-
removeSetChangeListener
- Specified by:
removeSetChangeListenerin interfaceIObservableSet<E>- Parameters:
listener- the change listener to remove; notnull
-
fireSetChange
-
fireChange
protected void fireChange()- Overrides:
fireChangein classAbstractObservable
-
firstListenerAdded
protected void firstListenerAdded()- Overrides:
firstListenerAddedin classDecoratingObservable
-
lastListenerRemoved
protected void lastListenerRemoved()- Overrides:
lastListenerRemovedin classDecoratingObservable
-
handleSetChange
Called whenever a SetChangeEvent is received from the decorated observable. By default, this method fires the set change event again, with the decorating observable as the event source. Subclasses may override to provide different behavior.- Parameters:
event- the change event received from the decorated observable
-
dispose
public void dispose()Description copied from interface:IObservableDisposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.- Specified by:
disposein interfaceIObservable- Overrides:
disposein classDecoratingObservableCollection<E>
-
addListener
- Parameters:
listenerType- arbitrary object to identify a type of the listenerlistener- the listener to add; notnull
-
removeListener
- Parameters:
listenerType- arbitrary object to identify a type of the listenerlistener- the listener to remove; notnull
-
hasListeners
protected boolean hasListeners() -
fireEvent
-
getRealm
- Returns:
- Returns the realm.
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-