KickJava   Java API By Example, From Geeks To Geeks.

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


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  * @since 1.0
16  *
17  */

18 public abstract class ChangeSupport extends ChangeManager {
19
20     /**
21      * @param realm
22      */

23     public ChangeSupport(Realm realm) {
24         super(realm);
25     }
26     
27     public void addListener(Object JavaDoc listenerType,
28             IObservablesListener listener) {
29         super.addListener(listenerType, listener);
30     }
31     
32     public void removeListener(Object JavaDoc listenerType,
33             IObservablesListener listener) {
34         super.removeListener(listenerType, listener);
35     }
36     
37     public void fireEvent(ObservableEvent event) {
38         super.fireEvent(event);
39     }
40     
41     /**
42      *
43      */

44     protected abstract void firstListenerAdded();
45     
46     /**
47      *
48      */

49     protected abstract void lastListenerRemoved();
50
51     /**
52      * @param listener
53      */

54     public void addChangeListener(IChangeListener listener) {
55         addListener(ChangeEvent.TYPE, listener);
56     }
57     
58     /**
59      * @param listener
60      */

61     public void removeChangeListener(IChangeListener listener) {
62         removeListener(ChangeEvent.TYPE, listener);
63     }
64
65     /**
66      * @param listener
67      */

68     public void addStaleListener(IStaleListener listener) {
69         addListener(StaleEvent.TYPE, listener);
70     }
71     
72     /**
73      * @param listener
74      */

75     public void removeStaleListener(IStaleListener listener) {
76         removeListener(StaleEvent.TYPE, listener);
77     }
78     
79 }
80
Popular Tags