Interface IResourceChangeEvent
There are currently five different types of resource change events:
-
Before-the-fact batch reports of arbitrary creations,
deletions and modifications to one or more resources expressed
as a hierarchical resource delta. Event type is
PRE_BUILD
, andgetDelta
returns the hierarchical delta rooted at the workspace root. ThegetBuildKind
method returns the kind of build that is about to occur, and thegetSource
method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties immediately before each build operation. If autobuilding is not enabled, these events still occur at times when autobuild would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during aPRE_BUILD
callback must be done in the thread doing the notification. -
After-the-fact batch reports of arbitrary creations,
deletions and modifications to one or more resources expressed
as a hierarchical resource delta. Event type is
POST_BUILD
, andgetDelta
returns the hierarchical delta rooted at the workspace root. ThegetBuildKind
method returns the kind of build that occurred, and thegetSource
method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties at the end of every build operation. If autobuilding is not enabled, these events still occur at times when autobuild would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during aPOST_BUILD
callback must be done in the thread doing the notification. -
After-the-fact batch reports of arbitrary creations,
deletions and modifications to one or more resources expressed
as a hierarchical resource delta. Event type is
POST_CHANGE
, andgetDelta
returns the hierarchical delta. The resource delta is rooted at the workspace root. These events are broadcast to interested parties after a set of resource changes and happen whether or not autobuilding is enabled. The workspace is closed for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. -
Before-the-fact reports of the impending closure of a single
project. Event type is
PRE_CLOSE
, andgetResource
returns the project being closed. The workspace is closed for change during notification of these events. -
Before-the-fact reports of the impending deletion of a single
project. Event type is
PRE_DELETE
, andgetResource
returns the project being deleted. The workspace is closed for change during notification of these events. -
Before-the-fact reports of the impending refresh of a single project or the workspace.
Event type is
PRE_REFRESH
and thegetSource
method returns the scope of the refresh (either the workspace or a single project). If the event is fired by a project refresh thegetResource
method returns the project being refreshed. The workspace is closed for changes during notification of these 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.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated.static final int
Event type constant (bit mask) indicating an after-the-fact report of a build.static final int
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 bygetDelta
.static final int
Deprecated.This event type has been renamed toPRE_BUILD
static final int
Event type constant (bit mask) indicating a before-the-fact report of a build.static final int
Event type constant (bit mask) indicating a before-the-fact report of the impending closure of a single project as returned bygetResource
.static final int
Event type constant (bit mask) indicating a before-the-fact report of the impending deletion of a single project as returned bygetResource
.static final int
Event type constant (bit mask) indicating a before-the-fact report of refreshing the workspace or a project. -
Method Summary
Modifier and TypeMethodDescriptionfindMarkerDeltas
(String type, boolean includeSubtypes) Returns all marker deltas of the specified type that are associated with resource deltas for this event.int
Returns the kind of build that caused this event, or0
if not applicable to this type of event.getDelta()
Returns a resource delta, rooted at the workspace, describing the set of changes that happened to resources in the workspace.Returns the resource in question ornull
if not applicable to this type of event.Returns an object identifying the source of this event.int
getType()
Returns the type of event being reported.
-
Field Details
-
POST_CHANGE
static final int POST_CHANGEEvent 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 bygetDelta
. See class comments for further details.- See Also:
-
PRE_CLOSE
static final int PRE_CLOSEEvent type constant (bit mask) indicating a before-the-fact report of the impending closure of a single project as returned bygetResource
. See class comments for further details.- See Also:
-
PRE_DELETE
static final int PRE_DELETEEvent type constant (bit mask) indicating a before-the-fact report of the impending deletion of a single project as returned bygetResource
. See class comments for further details.- See Also:
-
PRE_AUTO_BUILD
Deprecated.This event type has been renamed toPRE_BUILD
- See Also:
-
PRE_BUILD
static final int PRE_BUILDEvent type constant (bit mask) indicating a before-the-fact report of a build. The event contains a hierarchical resource delta as returned bygetDelta
. See class comments for further details.- Since:
- 3.0
- See Also:
-
POST_AUTO_BUILD
Deprecated.This event type has been renamed toPOST_BUILD
- See Also:
-
POST_BUILD
static final int POST_BUILDEvent type constant (bit mask) indicating an after-the-fact report of a build. The event contains a hierarchical resource delta as returned bygetDelta
. See class comments for further details.- Since:
- 3.0
- See Also:
-
PRE_REFRESH
static final int PRE_REFRESHEvent type constant (bit mask) indicating a before-the-fact report of refreshing the workspace or a project. See class comments for further details.- Since:
- 3.4
- See Also:
-
-
Method Details
-
findMarkerDeltas
Returns all marker deltas of the specified type that are associated with resource deltas for this event. IfincludeSubtypes
isfalse
, 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, ornull
to indicate all typesincludeSubtypes
- whether or not to consider sub-types of the given type- Returns:
- an array of marker deltas
- Since:
- 2.0
-
getBuildKind
int getBuildKind()Returns the kind of build that caused this event, or0
if not applicable to this type of event.If the event is a
PRE_BUILD
orPOST_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:
-
getDelta
IResourceDelta getDelta()Returns a resource delta, rooted at the workspace, describing the set of changes that happened to resources in the workspace. Returnsnull
if not applicable to this type of event.- Returns:
- the resource delta, or
null
if not applicable
-
getResource
IResource getResource()Returns the resource in question ornull
if not applicable to this type of event.If the event is of type
PRE_CLOSE
,PRE_DELETE
, orPRE_REFRESH
, then the resource will be the affected project. Otherwise the resource will benull
.- Returns:
- the resource, or
null
if not applicable
-
getSource
Object getSource()Returns an object identifying the source of this event.If the event is a
PRE_BUILD
,POST_BUILD
, orPRE_REFRESH
then this will be the scope of the build (either theIWorkspace
or a singleIProject
).- Returns:
- an object identifying the source of this event
- See Also:
-
getType
int getType()Returns the type of event being reported.- Returns:
- one of the event type constants
- See Also:
-
POST_BUILD