Mercurial > projects > dwt2
comparison org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/ValueChangeEvent.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.value; | |
13 | |
14 import org.eclipse.core.databinding.observable.IObservablesListener; | |
15 import org.eclipse.core.databinding.observable.ObservableEvent; | |
16 | |
17 /** | |
18 * Value change event describing a change of an {@link IObservableValue} | |
19 * object's current value. | |
20 * | |
21 * @since 1.0 | |
22 * | |
23 */ | |
24 public class ValueChangeEvent : ObservableEvent { | |
25 | |
26 /** | |
27 * | |
28 */ | |
29 private static final long serialVersionUID = 2305345286999701156L; | |
30 | |
31 static final Object TYPE = new Object(); | |
32 | |
33 /** | |
34 * Description of the change to the source observable value. Listeners must | |
35 * not change this field. | |
36 */ | |
37 public ValueDiff diff; | |
38 | |
39 /** | |
40 * Creates a new value change event. | |
41 * | |
42 * @param source | |
43 * the source observable value | |
44 * @param diff | |
45 * the value change | |
46 */ | |
47 public this(IObservableValue source, ValueDiff diff) { | |
48 super(source); | |
49 this.diff = diff; | |
50 } | |
51 | |
52 /** | |
53 * Returns the observable value from which this event originated. | |
54 * | |
55 * @return returns the observable value from which this event originated | |
56 */ | |
57 public IObservableValue getObservableValue() { | |
58 return cast(IObservableValue) source; | |
59 } | |
60 | |
61 protected void dispatch(IObservablesListener listener) { | |
62 (cast(IValueChangeListener) listener).handleValueChange(this); | |
63 } | |
64 | |
65 protected Object getListenerType() { | |
66 return TYPE; | |
67 } | |
68 | |
69 } |