1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core;
13 import java.util.EventObject;
16 * An element changed event describes a change to the structure or contents of a
17 * tree of Java elements. The changes to the elements are described by the
18 * associated delta object carried by this event.
20 * This class is not intended to be instantiated or subclassed by clients.
21 * Instances of this class are automatically created by the Java model.
24 * @see IElementChangedListener
25 * @see IJavaElementDelta
27 public class ElementChangedEvent extends EventObject {
30 * Event type constant (bit mask) indicating an after-the-fact report of
31 * creations, deletions, and modifications to one or more Java element(s)
32 * expressed as a hierarchical java element delta as returned by
33 * <code>getDelta()</code>.
35 * Note: this notification occurs during the corresponding POST_CHANGE
36 * resource change notification, and contains a full delta accounting for
37 * any JavaModel operation and/or resource change.
39 * @see IJavaElementDelta
40 * @see org.eclipse.core.resources.IResourceChangeEvent
44 public static final int POST_CHANGE = 1;
47 * Event type constant (bit mask) indicating an after-the-fact report of
48 * creations, deletions, and modifications to one or more Java element(s)
49 * expressed as a hierarchical java element delta as returned by
50 * <code>getDelta</code>.
52 * Note: this notification occurs during the corresponding PRE_AUTO_BUILD
53 * resource change notification. The delta, which is notified here, only
54 * contains information relative to the previous JavaModel operations (in
55 * other words, it ignores the possible resources which have changed outside
56 * Java operations). In particular, it is possible that the JavaModel be
57 * inconsistent with respect to resources, which got modified outside
58 * JavaModel operations (it will only be fully consistent once the
59 * POST_CHANGE notification has occurred).
61 * @see IJavaElementDelta
62 * @see org.eclipse.core.resources.IResourceChangeEvent
66 public static final int PRE_AUTO_BUILD = 2;
69 * Event type constant (bit mask) indicating an after-the-fact report of
70 * creations, deletions, and modifications to one or more Java element(s)
71 * expressed as a hierarchical java element delta as returned by
72 * <code>getDelta</code>.
74 * Note: this notification occurs as a result of a working copy reconcile
77 * @see IJavaElementDelta
78 * @see org.eclipse.core.resources.IResourceChangeEvent
82 public static final int POST_RECONCILE = 4;
85 * Event type indicating the nature of this event. It can be a combination
86 * either: - POST_CHANGE - PRE_AUTO_BUILD - POST_RECONCILE
91 * Creates an new element changed event (based on a
92 * <code>IJavaElementDelta</code>).
95 * the Java element delta.
97 public ElementChangedEvent(IJavaElementDelta delta, int type) {
103 * Returns the delta describing the change.
105 * @return the delta describing the change
107 public IJavaElementDelta getDelta() {
108 return (IJavaElementDelta) source;
112 * Returns the type of event being reported.
114 * @return one of the event type constants
116 * @see #PRE_AUTO_BUILD
117 * @see #POST_RECONCILE
120 public int getType() {