comparison org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/ListChangeEvent.d @ 95:6208d4f6a277

Added trees for databinding.beans and observable
author Frank Benoit <benoit@tionex.de>
date Tue, 21 Apr 2009 10:55:51 +0200
parents
children b74ac5dfcc06
comparison
equal deleted inserted replaced
94:1d37a7813832 95:6208d4f6a277
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.list;
13
14 import org.eclipse.core.databinding.observable.IObservablesListener;
15 import org.eclipse.core.databinding.observable.ObservableEvent;
16
17 /**
18 * List change event describing an incremental change of an
19 * {@link IObservableList} object.
20 *
21 * @since 1.0
22 */
23 public class ListChangeEvent : ObservableEvent {
24
25 /**
26 *
27 */
28 private static final long serialVersionUID = -9154315534258776672L;
29
30 static final Object TYPE = new Object();
31
32 /**
33 * Description of the change to the source observable list. Listeners must
34 * not change this field.
35 */
36 public ListDiff diff;
37
38 /**
39 * Creates a new list change event.
40 *
41 * @param source
42 * the source observable list
43 * @param diff
44 * the list change
45 */
46 public this(IObservableList source, ListDiff diff) {
47 super(source);
48 this.diff = diff;
49 }
50
51 /**
52 * Returns the observable list from which this event originated.
53 *
54 * @return the observable list from which this event originated
55 */
56 public IObservableList getObservableList() {
57 return cast(IObservableList) getSource();
58 }
59
60 protected void dispatch(IObservablesListener listener) {
61 (cast(IListChangeListener) listener).handleListChange(this);
62 }
63
64 protected Object getListenerType() {
65 return TYPE;
66 }
67
68 }