Eclipse Platform
Release 3.3

org.eclipse.core.databinding.observable
Class AbstractObservable

java.lang.Object
  extended byorg.eclipse.core.databinding.observable.ChangeManager
      extended byorg.eclipse.core.databinding.observable.AbstractObservable
All Implemented Interfaces:
IObservable
Direct Known Subclasses:
AbstractObservableSet, AbstractObservableValue, ObservableList, ObservableMap, ObservableSet

public abstract class AbstractObservable
extends org.eclipse.core.databinding.observable.ChangeManager
implements IObservable

Since:
1.0

Constructor Summary
AbstractObservable(Realm realm)
           
 
Method Summary
 void addChangeListener(IChangeListener listener)
          Adds the given change listener to the list of change 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 checkRealm()
          Asserts that the realm is the current realm.
 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 fireChange()
           
protected  void fireEvent(ObservableEvent event)
           
protected  void fireStale()
           
protected  void firstListenerAdded()
           
 Realm getRealm()
          Returns the realm for this observable.
protected  boolean hasListeners()
           
protected  void lastListenerRemoved()
           
 void removeChangeListener(IChangeListener listener)
          Removes the given change listener from the list of change 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
getRealm, isStale
 

Constructor Detail

AbstractObservable

public AbstractObservable(Realm realm)
Parameters:
realm -
Method Detail

addChangeListener

public void addChangeListener(IChangeListener listener)
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 interface IObservable
Parameters:
listener -

removeChangeListener

public void removeChangeListener(IChangeListener listener)
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 interface IObservable
Parameters:
listener -

addStaleListener

public void addStaleListener(IStaleListener listener)
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 interface IObservable
Parameters:
listener -
See Also:
IObservable.isStale()

removeStaleListener

public void removeStaleListener(IStaleListener listener)
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 interface IObservable
Parameters:
listener -

fireChange

protected void fireChange()

fireStale

protected void fireStale()

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 interface IObservable

checkRealm

protected void checkRealm()
Asserts that the realm is the current realm.

Throws:
AssertionFailedException - if the realm is not the current realm
See Also:
Realm.isCurrent()

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)

firstListenerAdded

protected void firstListenerAdded()

lastListenerRemoved

protected void lastListenerRemoved()

getRealm

public Realm getRealm()
Returns:
Returns the realm.

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.