|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IResourceChangeEvent
Resource change events describe changes to resources.
There are currently five different types of resource change events:
PRE_BUILD
, and getDelta
returns
the hierarchical delta. The resource delta is rooted at the
workspace root. The getBuildKind
method returns
the kind of build that is about to occur, and the getSource
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 a PRE_BUILD
callback
must be done in the thread doing the notification.
POST_BUILD
, and getDelta
returns
the hierarchical delta. The resource delta is rooted at the
workspace root. The getBuildKind
method returns
the kind of build that occurred, and the getSource
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 a POST_BUILD
callback
must be done in the thread doing the notification.
POST_CHANGE
, and getDelta
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.
PRE_CLOSE
,
and getResource
returns the project being closed.
The workspace is closed for change during notification of these events.
PRE_DELETE
,
and getResource
returns the project being deleted.
The workspace is closed for change during notification of these events.
PRE_REFRESH
and the getSource
method returns the scope of the refresh (either the workspace or a single project).
If the event is fired by a project refresh the getResource
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.
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 before-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 . |
static int |
PRE_REFRESH
Event type constant (bit mask) indicating a before-the-fact report of refreshing the workspace or a project. |
Method Summary | |
---|---|
IMarkerDelta[] |
findMarkerDeltas(java.lang.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. |
java.lang.Object |
getSource()
Returns an object identifying the source of this event. |
int |
getType()
Returns the type of event being reported. |
Field Detail |
---|
static final int POST_CHANGE
getDelta
.
See class comments for further details.
getType()
,
getDelta()
,
Constant Field Valuesstatic final int PRE_CLOSE
getResource
.
See class comments for further details.
getType()
,
getResource()
,
Constant Field Valuesstatic final int PRE_DELETE
getResource
.
See class comments for further details.
getType()
,
getResource()
,
Constant Field Valuesstatic final int PRE_AUTO_BUILD
PRE_BUILD
static final int PRE_BUILD
getDelta
.
See class comments for further details.
getType()
,
getResource()
,
Constant Field Valuesstatic final int POST_AUTO_BUILD
POST_BUILD
static final int POST_BUILD
getDelta
.
See class comments for further details.
getType()
,
getResource()
,
Constant Field Valuesstatic final int PRE_REFRESH
getType()
,
getSource()
,
getResource()
,
Constant Field ValuesMethod Detail |
---|
IMarkerDelta[] findMarkerDeltas(java.lang.String type, boolean includeSubtypes)
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.
type
- the type of marker to consider, or null
to indicate all typesincludeSubtypes
- whether or not to consider sub-types of the given type
int getBuildKind()
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.
0
if not applicableIProject.build(int, IProgressMonitor)
,
IWorkspace.build(int, IProgressMonitor)
,
IncrementalProjectBuilder.AUTO_BUILD
,
IncrementalProjectBuilder.FULL_BUILD
,
IncrementalProjectBuilder.INCREMENTAL_BUILD
,
IncrementalProjectBuilder.CLEAN_BUILD
IResourceDelta getDelta()
null
if not applicable to this type of event.
null
if not
applicableIResource getResource()
null
if not applicable to this type of event.
If the event is of type PRE_CLOSE
,
PRE_DELETE
, or PRE_REFRESH
, then the resource
will be the affected project. Otherwise the resource will be null
.
null
if not applicablejava.lang.Object getSource()
If the event is a PRE_BUILD
, POST_BUILD
,
or PRE_REFRESH
then this will be the scope of the build
(either the IWorkspace
or a single IProject
).
EventObject
int getType()
POST_CHANGE
,
POST_BUILD
,
PRE_BUILD
,
PRE_CLOSE
,
PRE_DELETE
,
PRE_REFRESH
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |