Mercurial > projects > dwt2
comparison org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.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.list.ListChangeEvent; | |
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 * List change event describing an incremental change of an | |
21 * {@link IObservableList} object. | |
22 * | |
23 * @since 1.0 | |
24 */ | |
25 public class ListChangeEvent : ObservableEvent { | |
26 | |
27 /** | |
28 * | |
29 */ | |
30 private static final long serialVersionUID = -9154315534258776672L; | |
31 | |
32 static final Object TYPE = new Object(); | |
33 | |
34 /** | |
35 * Description of the change to the source observable list. Listeners must | |
36 * not change this field. | |
37 */ | |
38 public ListDiff diff; | |
39 | |
40 /** | |
41 * Creates a new list change event. | |
42 * | |
43 * @param source | |
44 * the source observable list | |
45 * @param diff | |
46 * the list change | |
47 */ | |
48 public this(IObservableList source, ListDiff diff) { | |
49 super(source); | |
50 this.diff = diff; | |
51 } | |
52 | |
53 /** | |
54 * Returns the observable list from which this event originated. | |
55 * | |
56 * @return the observable list from which this event originated | |
57 */ | |
58 public IObservableList getObservableList() { | |
59 return cast(IObservableList) getSource(); | |
60 } | |
61 | |
62 protected void dispatch(IObservablesListener listener) { | |
63 (cast(IListChangeListener) listener).handleListChange(this); | |
64 } | |
65 | |
66 protected Object getListenerType() { | |
67 return TYPE; | |
68 } | |
69 | |
70 } |