KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > core > IModelChangedEvent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 package org.eclipse.pde.core;
12 /**
13  * Model change events are fired by the model when it is changed from the last
14  * clean state. Model change listeners can use these events to update
15  * accordingly.
16  *
17  * @since 2.0
18  */

19 public interface IModelChangedEvent {
20     /**
21      * Indicates a change where one or more objects are added to the model.
22      */

23     int INSERT = 1;
24     /**
25      * Indicates a change where one or more objects are removed from the model.
26      */

27     int REMOVE = 2;
28     /**
29      * Indicates that the model has been reloaded and that listeners should
30      * perform full refresh.
31      */

32     int WORLD_CHANGED = 99;
33     /**
34      * indicates that a model object's property has been changed.
35      */

36     int CHANGE = 3;
37     /**
38      * Returns the provider that fired this event.
39      *
40      * @return the event provider
41      */

42     public IModelChangeProvider getChangeProvider();
43     /**
44      * Returns an array of model objects that are affected by the change.
45      *
46      * @return array of affected objects
47      */

48     public Object JavaDoc[] getChangedObjects();
49     /**
50      * Returns a name of the object's property that has been changed if change
51      * type is CHANGE.
52      *
53      * @return property that has been changed in the model object, or <samp>null
54      * </samp> if type is not CHANGE or if more than one property has
55      * been changed.
56      */

57     public String JavaDoc getChangedProperty();
58     /**
59      * When model change is of type <samp>CHANGE</samp>, this method is used to
60      * obtain the old value of the property (before the change).
61      *
62      * @return the old value of the changed property
63      */

64     public Object JavaDoc getOldValue();
65     /**
66      * When model change is of type <samp>CHANGE</samp>, this method is used to
67      * obtain the new value of the property (after the change).
68      *
69      * @return the new value of the changed property.
70      */

71     public Object JavaDoc getNewValue();
72     /**
73      * Returns the type of change that occured in the model (one of <samp>INSERT</samp>,
74      * <samp>REMOVE</samp>, <samp>CHANGE</samp> or
75      * <samp>WORLD_CHANGED </samp>).
76      *
77      * @return type of change
78      */

79     public int getChangeType();
80 }
81
Popular Tags