KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > databinding > observable > list > ListChangeEvent


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 extends ObservableEvent {
24
25     /**
26      *
27      */

28     private static final long serialVersionUID = -9154315534258776672L;
29
30     static final Object JavaDoc TYPE = new Object JavaDoc();
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 ListChangeEvent(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 (IObservableList) getSource();
58     }
59
60     protected void dispatch(IObservablesListener listener) {
61         ((IListChangeListener) listener).handleListChange(this);
62     }
63
64     protected Object JavaDoc getListenerType() {
65         return TYPE;
66     }
67
68 }
69
Popular Tags