comparison org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/MapChangeEvent.d @ 78:0a55d2d5a946

Added file for databinding
author Frank Benoit <benoit@tionex.de>
date Tue, 14 Apr 2009 11:35:29 +0200
parents
children 383ce7bd736b
comparison
equal deleted inserted replaced
76:f05e6e8b2f2d 78:0a55d2d5a946
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;
13
14 import java.lang.all;
15
16 import org.eclipse.core.databinding.observable.IObservablesListener;
17 import org.eclipse.core.databinding.observable.ObservableEvent;
18
19 /**
20 * Map change event describing an incremental change of an
21 * {@link IObservableMap} object.
22 *
23 * @since 1.0
24 *
25 */
26 public class MapChangeEvent : ObservableEvent {
27
28 /**
29 *
30 */
31 private static final long serialVersionUID = -8092347212410548463L;
32 static final Object TYPE = new Object();
33
34 /**
35 * Description of the change to the source observable map. Listeners must
36 * not change this field.
37 */
38 public MapDiff diff;
39
40 /**
41 * Creates a new map change event
42 *
43 * @param source
44 * the source observable map
45 * @param diff
46 * the map change
47 */
48 public this(IObservableMap source, MapDiff diff) {
49 super(source);
50 this.diff = diff;
51 }
52
53 /**
54 * Returns the observable map from which this event originated.
55 *
56 * @return the observable map from which this event originated
57 */
58 public IObservableMap getObservableMap() {
59 return cast(IObservableMap) getSource();
60 }
61
62 protected void dispatch(IObservablesListener listener) {
63 (cast(IMapChangeListener) listener).handleMapChange(this);
64 }
65
66 protected Object getListenerType() {
67 return TYPE;
68 }
69
70 }