Eclipse Platform
Release 3.1

org.eclipse.core.resources
Interface IResourceChangeEvent


public interface IResourceChangeEvent

Resource change events describe changes to resources.

There are currently five different types of resource change events:

In order to handle additional event types that may be introduced in future releases of the platform, clients should do not write code that presumes the set of event types is closed.

This interface is not intended to be implemented by clients.


Field Summary
static int POST_AUTO_BUILD
          Deprecated. This event type has been renamed to POST_BUILD
static int POST_BUILD
          Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta.
static int POST_CHANGE
          Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta.
static int PRE_AUTO_BUILD
          Deprecated. This event type has been renamed to PRE_BUILD
static int PRE_BUILD
          Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta.
static int PRE_CLOSE
          Event type constant (bit mask) indicating a before-the-fact report of the impending closure of a single project as returned by getResource.
static int PRE_DELETE
          Event type constant (bit mask) indicating a before-the-fact report of the impending deletion of a single project as returned by getResource.
 
Method Summary
 IMarkerDelta[] findMarkerDeltas(String type, boolean includeSubtypes)
          Returns all marker deltas of the specified type that are associated with resource deltas for this event.
 int getBuildKind()
          Returns the kind of build that caused this event, or 0 if not applicable to this type of event.
 IResourceDelta getDelta()
          Returns a resource delta, rooted at the workspace, describing the set of changes that happened to resources in the workspace.
 IResource getResource()
          Returns the resource in question or null if not applicable to this type of event.
 Object getSource()
          Returns an object identifying the source of this event.
 int getType()
          Returns the type of event being reported.
 

Field Detail

POST_CHANGE

public static final int POST_CHANGE
Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta. See class comments for further details.

See Also:
getType(), getDelta(), Constant Field Values

PRE_CLOSE

public static final int PRE_CLOSE
Event type constant (bit mask) indicating a before-the-fact report of the impending closure of a single project as returned by getResource. See class comments for further details.

See Also:
getType(), getResource(), Constant Field Values

PRE_DELETE

public static final int PRE_DELETE
Event type constant (bit mask) indicating a before-the-fact report of the impending deletion of a single project as returned by getResource. See class comments for further details.

See Also:
getType(), getResource(), Constant Field Values

PRE_AUTO_BUILD

public static final int PRE_AUTO_BUILD
Deprecated. This event type has been renamed to PRE_BUILD

See Also:
Constant Field Values

PRE_BUILD

public static final int PRE_BUILD
Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta. See class comments for further details.

Since:
3.0
See Also:
getType(), getResource(), Constant Field Values

POST_AUTO_BUILD

public static final int POST_AUTO_BUILD
Deprecated. This event type has been renamed to POST_BUILD

See Also:
Constant Field Values

POST_BUILD

public static final int POST_BUILD
Event type constant (bit mask) indicating an after-the-fact report of creations, deletions, and modifications to one or more resources expressed as a hierarchical resource delta as returned by getDelta. See class comments for further details.

Since:
3.0
See Also:
getType(), getResource(), Constant Field Values
Method Detail

findMarkerDeltas

public IMarkerDelta[] findMarkerDeltas(String type,
                                       boolean includeSubtypes)
Returns all marker deltas of the specified type that are associated with resource deltas for this event. If includeSubtypes is false, only marker deltas whose type exactly matches the given type are returned. Returns an empty array if there are no matching marker deltas.

Calling this method is equivalent to walking the entire resource delta for this event, and collecting all marker deltas of a given type. The speed of this method will be proportional to the number of changed markers, regardless of the size of the resource delta tree.

Parameters:
type - the type of marker to consider, or null to indicate all types
includeSubtypes - whether or not to consider sub-types of the given type
Returns:
an array of marker deltas
Since:
2.0

getBuildKind

public int getBuildKind()
Returns the kind of build that caused this event, or 0 if not applicable to this type of event.

If the event is a PRE_BUILD or POST_BUILD then this will be the kind of build that occurred to cause the event.

Returns:
the kind of build, or 0 if not applicable
Since:
3.1
See Also:
IProject.build(int, IProgressMonitor), IWorkspace.build(int, IProgressMonitor), IncrementalProjectBuilder.AUTO_BUILD, IncrementalProjectBuilder.FULL_BUILD, IncrementalProjectBuilder.INCREMENTAL_BUILD, IncrementalProjectBuilder.CLEAN_BUILD

getDelta

public IResourceDelta getDelta()
Returns a resource delta, rooted at the workspace, describing the set of changes that happened to resources in the workspace. Returns null if not applicable to this type of event.

Returns:
the resource delta, or null if not applicable

getResource

public IResource getResource()
Returns the resource in question or null if not applicable to this type of event.

If the event is a PRE_CLOSE or PRE_DELETE event then the resource will be the affected project. Otherwise the resource will be null.

Returns:
the resource, or null if not applicable

getSource

public Object getSource()
Returns an object identifying the source of this event.

Returns:
an object identifying the source of this event
See Also:
EventObject

getType

public int getType()
Returns the type of event being reported.

Returns:
one of the event type constants
See Also:
POST_CHANGE, POST_BUILD, PRE_BUILD, PRE_CLOSE, PRE_DELETE

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.