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
-
-
Constructor Summary
Constructors Constructor Description DecoratingObservableSet(IObservableSet<E> decorated, boolean disposeDecoratedOnDispose)Constructs a DecoratingObservableSet which decorates the given observable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 voidfireChange()protected voidfireEvent(ObservableEvent event)protected voidfireSetChange(SetDiff<E> diff)protected voidfirstListenerAdded()RealmgetRealm()protected voidhandleSetChange(SetChangeEvent<? extends E> event)Called whenever a SetChangeEvent is received from the decorated observable.protected booleanhasListeners()protected voidlastListenerRemoved()protected 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, toString
-
Methods inherited from class org.eclipse.core.databinding.observable.DecoratingObservable
getDecorated, getterCalled, handleStaleEvent, isStale
-
Methods inherited from class org.eclipse.core.databinding.observable.AbstractObservable
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListener
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListener
-
Methods inherited from interface org.eclipse.core.databinding.observable.set.IObservableSet
add, addAll, contains, containsAll, equals, getElementType, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Constructor Detail
-
DecoratingObservableSet
public DecoratingObservableSet(IObservableSet<E> decorated, boolean disposeDecoratedOnDispose)
Constructs a DecoratingObservableSet which decorates the given observable.- Parameters:
decorated- the observable set being decorateddisposeDecoratedOnDispose-
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceSet<E>- Overrides:
clearin classDecoratingObservableCollection<E>
-
addSetChangeListener
public void addSetChangeListener(ISetChangeListener<? super E> listener)
- Specified by:
addSetChangeListenerin interfaceIObservableSet<E>
-
removeSetChangeListener
public void removeSetChangeListener(ISetChangeListener<? super E> listener)
- Specified by:
removeSetChangeListenerin interfaceIObservableSet<E>
-
fireChange
protected void fireChange()
- Overrides:
fireChangein classAbstractObservable
-
firstListenerAdded
protected void firstListenerAdded()
- Overrides:
firstListenerAddedin classDecoratingObservable
-
lastListenerRemoved
protected void lastListenerRemoved()
- Overrides:
lastListenerRemovedin classDecoratingObservable
-
handleSetChange
protected void handleSetChange(SetChangeEvent<? extends E> event)
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
protected void addListener(Object listenerType, IObservablesListener listener)
- Parameters:
listenerType-listener-
-
removeListener
protected void removeListener(Object listenerType, IObservablesListener listener)
- Parameters:
listenerType-listener-
-
hasListeners
protected boolean hasListeners()
-
fireEvent
protected void fireEvent(ObservableEvent event)
-
getRealm
public Realm getRealm()
- Returns:
- Returns the realm.
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-