org.eclipse.core.internal.events
Class ResourceChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.eclipse.core.internal.events.ResourceChangeEvent
All Implemented Interfaces:
java.io.Serializable, IResourceChangeEvent

public class ResourceChangeEvent
extends java.util.EventObject
implements IResourceChangeEvent

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.eclipse.core.resources.IResourceChangeEvent
POST_AUTO_BUILD, POST_BUILD, POST_CHANGE, PRE_AUTO_BUILD, PRE_BUILD, PRE_CLOSE, PRE_DELETE, PRE_REFRESH
 
Constructor Summary
ResourceChangeEvent(java.lang.Object source, int type, int buildKind, IResourceDelta delta)
           
 
Method Summary
 IMarkerDelta[] findMarkerDeltas(java.lang.String findType, 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.
 int getType()
          Returns the type of event being reported.
 void setDelta(IResourceDelta value)
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.resources.IResourceChangeEvent
getSource
 

Constructor Detail

ResourceChangeEvent

public ResourceChangeEvent(java.lang.Object source,
                           int type,
                           int buildKind,
                           IResourceDelta delta)
Method Detail

findMarkerDeltas

public IMarkerDelta[] findMarkerDeltas(java.lang.String findType,
                                       boolean includeSubtypes)
Description copied from interface: IResourceChangeEvent
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.

Specified by:
findMarkerDeltas in interface IResourceChangeEvent
Parameters:
findType - 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
See Also:
IResourceChangeEvent.findMarkerDeltas(String, boolean)

getBuildKind

public int getBuildKind()
Description copied from interface: IResourceChangeEvent
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.

Specified by:
getBuildKind in interface IResourceChangeEvent
Returns:
the kind of build, or 0 if not applicable
See Also:
IResourceChangeEvent.getBuildKind()

getDelta

public IResourceDelta getDelta()
Description copied from interface: IResourceChangeEvent
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.

Specified by:
getDelta in interface IResourceChangeEvent
Returns:
the resource delta, or null if not applicable
See Also:
IResourceChangeEvent.getDelta()

getResource

public IResource getResource()
Description copied from interface: IResourceChangeEvent
Returns the resource in question or 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.

Specified by:
getResource in interface IResourceChangeEvent
Returns:
the resource, or null if not applicable
See Also:
IResourceChangeEvent.getResource()

getType

public int getType()
Description copied from interface: IResourceChangeEvent
Returns the type of event being reported.

Specified by:
getType in interface IResourceChangeEvent
Returns:
one of the event type constants
See Also:
IResourceChangeEvent.getType()

setDelta

public void setDelta(IResourceDelta value)