78
|
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 module org.eclipse.core.databinding.observable.map.MapChangeEvent;
|
81
|
13 import org.eclipse.core.databinding.observable.map.MapDiff;
|
|
14 import org.eclipse.core.databinding.observable.map.IMapChangeListener;
|
|
15 import org.eclipse.core.databinding.observable.map.IObservableMap;
|
78
|
16
|
|
17 import java.lang.all;
|
|
18
|
|
19 import org.eclipse.core.databinding.observable.IObservablesListener;
|
|
20 import org.eclipse.core.databinding.observable.ObservableEvent;
|
|
21
|
|
22 /**
|
|
23 * Map change event describing an incremental change of an
|
|
24 * {@link IObservableMap} object.
|
|
25 *
|
|
26 * @since 1.0
|
|
27 *
|
|
28 */
|
|
29 public class MapChangeEvent : ObservableEvent {
|
|
30
|
|
31 /**
|
|
32 *
|
|
33 */
|
85
|
34 private static const long serialVersionUID = -8092347212410548463L;
|
|
35 static const Object TYPE;
|
|
36 static this(){
|
|
37 TYPE = new Object();
|
|
38 }
|
78
|
39
|
|
40 /**
|
|
41 * Description of the change to the source observable map. Listeners must
|
|
42 * not change this field.
|
|
43 */
|
|
44 public MapDiff diff;
|
|
45
|
|
46 /**
|
|
47 * Creates a new map change event
|
|
48 *
|
|
49 * @param source
|
|
50 * the source observable map
|
|
51 * @param diff
|
|
52 * the map change
|
|
53 */
|
|
54 public this(IObservableMap source, MapDiff diff) {
|
|
55 super(source);
|
|
56 this.diff = diff;
|
|
57 }
|
|
58
|
|
59 /**
|
|
60 * Returns the observable map from which this event originated.
|
|
61 *
|
|
62 * @return the observable map from which this event originated
|
|
63 */
|
|
64 public IObservableMap getObservableMap() {
|
|
65 return cast(IObservableMap) getSource();
|
|
66 }
|
|
67
|
|
68 protected void dispatch(IObservablesListener listener) {
|
|
69 (cast(IMapChangeListener) listener).handleMapChange(this);
|
|
70 }
|
|
71
|
|
72 protected Object getListenerType() {
|
|
73 return TYPE;
|
|
74 }
|
|
75
|
|
76 }
|