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.set.SetChangeEvent;
|
81
|
13 import org.eclipse.core.databinding.observable.set.SetDiff;
|
|
14 import org.eclipse.core.databinding.observable.set.ISetChangeListener;
|
|
15 import org.eclipse.core.databinding.observable.set.IObservableSet;
|
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 * List change event describing an incremental change of an
|
|
24 * {@link IObservableSet} object.
|
|
25 *
|
|
26 * @since 1.0
|
|
27 *
|
|
28 */
|
|
29 public class SetChangeEvent : ObservableEvent {
|
|
30
|
|
31 /**
|
|
32 *
|
|
33 */
|
|
34 private static final long serialVersionUID = 7436547103857482256L;
|
|
35 static final Object TYPE = new Object();
|
|
36
|
|
37 /**
|
|
38 * Description of the change to the source observable set. Listeners must
|
|
39 * not change this field.
|
|
40 */
|
|
41 public SetDiff diff;
|
|
42
|
|
43 /**
|
|
44 * Creates a new set change event.
|
|
45 *
|
|
46 * @param source
|
|
47 * the source observable set
|
|
48 * @param diff
|
|
49 * the set change
|
|
50 */
|
|
51 public this(IObservableSet source, SetDiff diff) {
|
|
52 super(source);
|
|
53 this.diff = diff;
|
|
54 }
|
|
55
|
|
56 /**
|
|
57 * Returns the observable set from which this event originated.
|
|
58 *
|
|
59 * @return the observable set from which this event originated
|
|
60 */
|
|
61 public IObservableSet getObservableSet() {
|
|
62 return cast(IObservableSet) getSource();
|
|
63 }
|
|
64
|
|
65 protected void dispatch(IObservablesListener listener) {
|
|
66 (cast(ISetChangeListener) listener).handleSetChange(this);
|
|
67 }
|
|
68
|
|
69 protected Object getListenerType() {
|
|
70 return TYPE;
|
|
71 }
|
|
72
|
|
73 }
|