01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.core;
11:
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: /**
39: * Returns the provider that fired this event.
40: *
41: * @return the event provider
42: */
43: public IModelChangeProvider getChangeProvider();
44:
45: /**
46: * Returns an array of model objects that are affected by the change.
47: *
48: * @return array of affected objects
49: */
50: public Object[] getChangedObjects();
51:
52: /**
53: * Returns a name of the object's property that has been changed if change
54: * type is CHANGE.
55: *
56: * @return property that has been changed in the model object, or <samp>null
57: * </samp> if type is not CHANGE or if more than one property has
58: * been changed.
59: */
60: public String getChangedProperty();
61:
62: /**
63: * When model change is of type <samp>CHANGE</samp>, this method is used to
64: * obtain the old value of the property (before the change).
65: *
66: * @return the old value of the changed property
67: */
68: public Object getOldValue();
69:
70: /**
71: * When model change is of type <samp>CHANGE</samp>, this method is used to
72: * obtain the new value of the property (after the change).
73: *
74: * @return the new value of the changed property.
75: */
76: public Object getNewValue();
77:
78: /**
79: * Returns the type of change that occured in the model (one of <samp>INSERT</samp>,
80: * <samp>REMOVE</samp>, <samp>CHANGE</samp> or
81: * <samp>WORLD_CHANGED </samp>).
82: *
83: * @return type of change
84: */
85: public int getChangeType();
86: }
|