Class AbstractObservable
java.lang.Object
org.eclipse.core.databinding.observable.AbstractObservable
- All Implemented Interfaces:
IObservable
- Direct Known Subclasses:
AbstractObservableSet
,AbstractObservableValue
,DecoratingObservable
,ObservableList
,ObservableMap
,ObservableSet
- Since:
- 1.0
- 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(IChangeListener listener) Adds the given change listener to the list of change listeners.void
addDisposeListener
(IDisposeListener listener) Adds the given dispose listener to the list of dispose listeners.protected void
addListener
(Object listenerType, IObservablesListener listener) void
addStaleListener
(IStaleListener listener) Adds the given stale listener to the list of stale listeners.protected void
Asserts that the realm is the current realm.protected Object
clone()
void
dispose()
Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.protected void
protected void
fireEvent
(ObservableEvent event) protected void
protected void
getRealm()
protected boolean
boolean
Returns whether the observable has been disposedprotected void
void
removeChangeListener
(IChangeListener listener) Removes the given change listener from the list of change listeners.void
removeDisposeListener
(IDisposeListener listener) Removes the given dispose listener from the list of dispose listeners.protected void
removeListener
(Object listenerType, IObservablesListener listener) void
removeStaleListener
(IStaleListener listener) Removes the given stale listener from the list of stale listeners.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
getRealm, isStale
-
Constructor Details
-
AbstractObservable
- Parameters:
realm
- the realm to use; notnull
-
-
Method Details
-
addChangeListener
Description copied from interface:IObservable
Adds the given change listener to the list of change listeners. Change listeners are notified about changes of the state of this observable in a generic way, without specifying the change that happened. To get the changed state, a change listener needs to query for the current state of this observable.- Specified by:
addChangeListener
in interfaceIObservable
- Parameters:
listener
- the listener to add; notnull
-
removeChangeListener
Description copied from interface:IObservable
Removes the given change listener from the list of change listeners. Has no effect if the given listener is not registered as a change listener.- Specified by:
removeChangeListener
in interfaceIObservable
- Parameters:
listener
- the listener to remove; notnull
-
addStaleListener
Description copied from interface:IObservable
Adds the given stale listener to the list of stale listeners. Stale listeners are notified when an observable object becomes stale, not when is becomes non-stale.- Specified by:
addStaleListener
in interfaceIObservable
- Parameters:
listener
- the listener to add; notnull
- See Also:
-
removeStaleListener
Description copied from interface:IObservable
Removes the given stale listener from the list of stale listeners. Has no effect if the given listener is not registered as a stale listener.- Specified by:
removeStaleListener
in interfaceIObservable
- Parameters:
listener
- the listener to remove; notnull
-
addDisposeListener
Description copied from interface:IObservable
Adds the given dispose listener to the list of dispose listeners. Dispose listeners are notified when an observable has been disposed.- Specified by:
addDisposeListener
in interfaceIObservable
- Parameters:
listener
- the listener to add- Since:
- 1.2
-
removeDisposeListener
Description copied from interface:IObservable
Removes the given dispose listener from the list of dispose listeners. Has no effect if the given listener is not registered as a dispose listener.- Specified by:
removeDisposeListener
in interfaceIObservable
- Parameters:
listener
- the listener to remove- Since:
- 1.2
-
fireChange
protected void fireChange() -
fireStale
protected void fireStale() -
isDisposed
public boolean isDisposed()Description copied from interface:IObservable
Returns whether the observable has been disposed- Specified by:
isDisposed
in interfaceIObservable
- Returns:
- whether the observable has been disposed
- Since:
- 1.2
-
dispose
public void dispose()Description copied from interface:IObservable
Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.- Specified by:
dispose
in interfaceIObservable
-
checkRealm
protected void checkRealm()Asserts that the realm is the current realm.- Throws:
AssertionFailedException
- if the realm is not the current realm- See Also:
-
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
-
firstListenerAdded
protected void firstListenerAdded() -
lastListenerRemoved
protected void lastListenerRemoved() -
getRealm
- Returns:
- Returns the realm.
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-