KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > databinding > provisional > observable > IObservable


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.internal.databinding.provisional.observable;
12
13 /**
14  * An object with state that allows to listen for state changes.
15  *
16  * @since 1.0
17  *
18  */

19 public interface IObservable {
20
21     /**
22      * Adds the given change listener to the list of change listeners.
23      * @param listener
24      */

25     public void addChangeListener(IChangeListener listener);
26
27     /**
28      * Removes the given change listener from the list of change listeners.
29      * Has no effect if the given listener is not registered as a change listener.
30      * @param listener
31      */

32     public void removeChangeListener(IChangeListener listener);
33
34     /**
35      * Adds the given stale listener to the list of stale listeners.
36      * @param listener
37      */

38     public void addStaleListener(IStaleListener listener);
39
40     /**
41      * Removes the given stale listener from the list of stale listeners.
42      * Has no effect if the given listener is not registered as a stale listener.
43      * @param listener
44      */

45     public void removeStaleListener(IStaleListener listener);
46
47     /**
48      * Returns whether the state of this observable is stale. A non-stale object
49      * that becomes stale will notify its stale listeners. A stale object that
50      * becomes non-stale does so by changing its state and notifying its change
51      * listeners. Clients that do not expect asynchronous changes may ignore
52      * staleness of observable objects.
53      *
54      * @return true if this observable's state is stale and will change soon.
55      *
56      * @TrackedGetter - implementers must call {@link ObservableTracker#getterCalled(IObservable)}.
57      */

58     public boolean isStale();
59     
60     /**
61      * Disposes of this observable object, removing all listeners registered with this
62      * object, and all listeners this object might have registered on other objects.
63      */

64     public void dispose();
65 }
66
Popular Tags