KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > databinding > observable > StaleEvent


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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
12 package org.eclipse.core.databinding.observable;
13
14 /**
15  * Generic event denoting that the state of an {@link IObservable} object is
16  * about to change. Note that this event is only fired when an observable
17  * becomes stale, not when it becomes unstale; an observable that becomes
18  * unstale should always fire a change event. Staleness can be used (for
19  * example) to notify listeners when an observable has started a background
20  * thread for updating its state. Clients can safely ignore staleness.
21  *
22  * @see IObservable#isStale()
23  *
24  * @since 1.0
25  *
26  */

27 public class StaleEvent extends ObservableEvent {
28
29     /**
30      * Creates a new stale event.
31      *
32      * @param source
33      * the source observable
34      */

35     public StaleEvent(IObservable source) {
36         super(source);
37     }
38
39     /**
40      *
41      */

42     private static final long serialVersionUID = 3491012225431471077L;
43
44     static final Object JavaDoc TYPE = new Object JavaDoc();
45
46     protected void dispatch(IObservablesListener listener) {
47         ((IStaleListener) listener).handleStale(this);
48     }
49
50     protected Object JavaDoc getListenerType() {
51         return TYPE;
52     }
53
54 }
55
Popular Tags