|
|||||||||
| Home >> All >> org >> eclipse >> core >> [ resources overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.core.resources
Interface IResourceDelta

- All Superinterfaces:
- org.eclipse.core.runtime.IAdaptable
- public interface IResourceDelta
- extends org.eclipse.core.runtime.IAdaptable
A resource delta represents changes in the state of a resource tree between two discrete points in time.
This interface is not intended to be implemented by clients.
Resource deltas implement the IAdaptable interface;
extensions are managed by the platform's adapter manager.
| Field Summary | |
static int |
ADDED
Delta kind constant (bit mask) indicating that the resource has been added to its parent. |
static int |
ADDED_PHANTOM
Delta kind constant (bit mask) indicating that a phantom resource has been added at the location of the delta node. |
static int |
ALL_WITH_PHANTOMS
The bit mask which describes all possible delta kinds, including ones involving phantoms. |
static int |
CHANGED
Delta kind constant (bit mask) indicating that the resource has been changed. |
static int |
CONTENT
Change constant (bit mask) indicating that the content of the resource has changed. |
static int |
DESCRIPTION
Change constant (bit mask) indicating that a project's description has changed. |
static int |
ENCODING
Change constant (bit mask) indicating that the encoding of the resource has changed. |
static int |
MARKERS
Change constant (bit mask) indicating that the resource's markers have changed. |
static int |
MOVED_FROM
Change constant (bit mask) indicating that the resource was moved from another location. |
static int |
MOVED_TO
Change constant (bit mask) indicating that the resource was moved to another location. |
static int |
NO_CHANGE
Delta kind constant indicating that the resource has not been changed in any way. |
static int |
OPEN
Change constant (bit mask) indicating that the resource was opened or closed. |
static int |
REMOVED
Delta kind constant (bit mask) indicating that the resource has been removed from its parent. |
static int |
REMOVED_PHANTOM
Delta kind constant (bit mask) indicating that a phantom resource has been removed from the location of the delta node. |
static int |
REPLACED
Change constant (bit mask) indicating that the resource has been replaced by another at the same location (i.e., the resource has been deleted and then added). |
static int |
SYNC
Change constant (bit mask) indicating that the resource's sync status has changed. |
static int |
TYPE
Change constant (bit mask) indicating that the type of the resource has changed. |
| Method Summary | |
void |
accept(IResourceDeltaVisitor visitor)
Accepts the given visitor. |
void |
accept(IResourceDeltaVisitor visitor,
boolean includePhantoms)
Accepts the given visitor. |
void |
accept(IResourceDeltaVisitor visitor,
int memberFlags)
Accepts the given visitor. |
IResourceDelta |
findMember(org.eclipse.core.runtime.IPath path)
Finds and returns the descendent delta identified by the given path in this delta, or null if no such descendent exists. |
IResourceDelta[] |
getAffectedChildren()
Returns resource deltas for all children of this resource which were added, removed, or changed. |
IResourceDelta[] |
getAffectedChildren(int kindMask)
Returns resource deltas for all children of this resource whose kind is included in the given mask. |
IResourceDelta[] |
getAffectedChildren(int kindMask,
int memberFlags)
Returns resource deltas for all children of this resource whose kind is included in the given mask. |
int |
getFlags()
Returns flags which describe in more detail how a resource has been affected. |
org.eclipse.core.runtime.IPath |
getFullPath()
Returns the full, absolute path of this resource delta. |
int |
getKind()
Returns the kind of this resource delta. |
IMarkerDelta[] |
getMarkerDeltas()
Returns the changes to markers on the corresponding resource. |
org.eclipse.core.runtime.IPath |
getMovedFromPath()
Returns the full path (in the "before" state) from which this resource (in the "after" state) was moved. |
org.eclipse.core.runtime.IPath |
getMovedToPath()
Returns the full path (in the "after" state) to which this resource (in the "before" state) was moved. |
org.eclipse.core.runtime.IPath |
getProjectRelativePath()
Returns the project-relative path of this resource delta. |
IResource |
getResource()
Returns a handle for the affected resource. |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
| Field Detail |
NO_CHANGE
public static final int NO_CHANGE
- Delta kind constant indicating that the resource has not been changed in any way.
- See Also:
getKind()55 , Constant Field Values
ADDED
public static final int ADDED
- Delta kind constant (bit mask) indicating that the resource has been added
to its parent. That is, one that appears in the "after" state,
not in the "before" one.
- See Also:
getKind()55 , Constant Field Values
REMOVED
public static final int REMOVED
- Delta kind constant (bit mask) indicating that the resource has been removed
from its parent. That is, one that appears in the "before" state,
not in the "after" one.
- See Also:
getKind()55 , Constant Field Values
CHANGED
public static final int CHANGED
- Delta kind constant (bit mask) indicating that the resource has been changed.
That is, one that appears in both the "before" and "after" states.
- See Also:
getKind()55 , Constant Field Values
ADDED_PHANTOM
public static final int ADDED_PHANTOM
- Delta kind constant (bit mask) indicating that a phantom resource has been added at
the location of the delta node.
- See Also:
getKind()55 , Constant Field Values
REMOVED_PHANTOM
public static final int REMOVED_PHANTOM
- Delta kind constant (bit mask) indicating that a phantom resource has been removed from
the location of the delta node.
- See Also:
getKind()55 , Constant Field Values
ALL_WITH_PHANTOMS
public static final int ALL_WITH_PHANTOMS
- The bit mask which describes all possible delta kinds,
including ones involving phantoms.
- See Also:
getKind()55 , Constant Field Values
CONTENT
public static final int CONTENT
- Change constant (bit mask) indicating that the content of the resource has changed.
- See Also:
getFlags()55 , Constant Field Values
MOVED_FROM
public static final int MOVED_FROM
- Change constant (bit mask) indicating that the resource was moved from another location.
The location in the "before" state can be retrieved using
getMovedFromPath().- See Also:
getFlags()55 , Constant Field Values
MOVED_TO
public static final int MOVED_TO
- Change constant (bit mask) indicating that the resource was moved to another location.
The location in the new state can be retrieved using
getMovedToPath().- See Also:
getFlags()55 , Constant Field Values
OPEN
public static final int OPEN
- Change constant (bit mask) indicating that the resource was opened or closed.
For example, if the current state of the resource is open then
it was previously closed.
- See Also:
getFlags()55 , Constant Field Values
TYPE
public static final int TYPE
- Change constant (bit mask) indicating that the type of the resource has changed.
- See Also:
getFlags()55 , Constant Field Values
SYNC
public static final int SYNC
- Change constant (bit mask) indicating that the resource's sync status has changed.
This type of change is not included in build deltas, only in those for resource notification.
- See Also:
getFlags()55 , Constant Field Values
MARKERS
public static final int MARKERS
- Change constant (bit mask) indicating that the resource's markers have changed.
This type of change is not included in build deltas, only in those for resource notification.
- See Also:
getFlags()55 , Constant Field Values
REPLACED
public static final int REPLACED
- Change constant (bit mask) indicating that the resource has been
replaced by another at the same location (i.e., the resource has
been deleted and then added).
- See Also:
getFlags()55 , Constant Field Values
DESCRIPTION
public static final int DESCRIPTION
- Change constant (bit mask) indicating that a project's description has changed.
- See Also:
getFlags()55 , Constant Field Values
ENCODING
public static final int ENCODING
- Change constant (bit mask) indicating that the encoding of the resource has changed.
- Since:
- 3.0
- See Also:
getFlags()55 , Constant Field Values
| Method Detail |
accept
public void accept(IResourceDeltaVisitor visitor) throws org.eclipse.core.runtime.CoreException
- Accepts the given visitor.
The only kinds of resource deltas visited
are
ADDED,REMOVED, andCHANGED. The visitor'svisitmethod is called with this resource delta if applicable. If the visitor returnstrue, the resource delta's children are also visited.This is a convenience method, fully equivalent to
accept(visitor, IResource.NONE). Although the visitor will be invoked for this resource delta, it will not be invoked for any team-private member resources.
accept
public void accept(IResourceDeltaVisitor visitor, boolean includePhantoms) throws org.eclipse.core.runtime.CoreException
- Accepts the given visitor.
The visitor's
visitmethod is called with this resource delta. If the visitor returnstrue, the resource delta's children are also visited.This is a convenience method, fully equivalent to:
accept(visitor, includePhantoms ? INCLUDE_PHANTOMS : IResource.NONE);
Although the visitor will be invoked for this resource delta, it will not be invoked for any team-private member resources.
accept
public void accept(IResourceDeltaVisitor visitor, int memberFlags) throws org.eclipse.core.runtime.CoreException
- Accepts the given visitor.
The visitor's
visitmethod is called with this resource delta. If the visitor returnstrue, the resource delta's children are also visited.The member flags determine which child deltas of this resource delta will be visited. The visitor will always be invoked for this resource delta.
If the
INCLUDE_PHANTOMSmember flag is not specified (recommended), only child resource deltas involving existing resources will be visited (kindsADDED,REMOVED, andCHANGED). If theINCLUDE_PHANTOMSmember flag is specified, the result will also include additions and removes of phantom resources (kindsADDED_PHANTOMandREMOVED_PHANTOM).If the
INCLUDE_TEAM_PRIVATE_MEMBERSmember flag is not specified (recommended), resource deltas involving team private member resources will be excluded from the visit. If theINCLUDE_TEAM_PRIVATE_MEMBERSmember flag is specified, the visit will also include additions and removes of team private member resources.- Since:
- 2.0
findMember
public IResourceDelta findMember(org.eclipse.core.runtime.IPath path)
- Finds and returns the descendent delta identified by the given path in
this delta, or
nullif no such descendent exists. The supplied path may be absolute or relative; in either case, it is interpreted as relative to this delta. Trailing separators are ignored. If the path is empty this delta is returned.This is a convenience method to avoid manual traversal of the delta tree in cases where the listener is only interested in changes to particular resources. Calling this method will generally be faster than manually traversing the delta to a particular descendent.
- Since:
- 2.0
getAffectedChildren
public IResourceDelta[] getAffectedChildren()
- Returns resource deltas for all children of this resource
which were added, removed, or changed. Returns an empty
array if there are no affected children.
This is a convenience method, fully equivalent to:
getAffectedChildren(ADDED | REMOVED | CHANGED, IResource.NONE);
Team-private member resources are not included in the result; neither are phantom resources.
getAffectedChildren
public IResourceDelta[] getAffectedChildren(int kindMask)
- Returns resource deltas for all children of this resource
whose kind is included in the given mask. Kind masks are formed
by the bitwise or of
IResourceDeltakind constants. Returns an empty array if there are no affected children.This is a convenience method, fully equivalent to:
getAffectedChildren(kindMask, IResource.NONE);
Team-private member resources are not included in the result.
getAffectedChildren
public IResourceDelta[] getAffectedChildren(int kindMask, int memberFlags)
- Returns resource deltas for all children of this resource
whose kind is included in the given mask. Masks are formed
by the bitwise or of
IResourceDeltakind constants. Returns an empty array if there are no affected children.If the
INCLUDE_TEAM_PRIVATE_MEMBERSmember flag is not specified, (recommended), resource deltas involving team private member resources will be excluded. If theINCLUDE_TEAM_PRIVATE_MEMBERSmember flag is specified, the result will also include resource deltas of the specified kinds to team private member resources.Specifying the
INCLUDE_PHANTOMSmember flag is equivalent to includingADDED_PHANTOMandREMOVED_PHANTOMin the kind mask.- Since:
- 2.0
getFlags
public int getFlags()
- Returns flags which describe in more detail how a resource has been affected.
The following codes (bit masks) are used when kind is
CHANGED, and also when the resource is involved in a move:CONTENT- The bytes contained by the resource have been altered, orIResource.touchhas been called on the resource.ENCODING- The encoding of the resource has been altered.DESCRIPTION- The description of the project has been altered, orIResource.touchhas been called on the project. This flag is only valid for project resources.OPEN- The project's open/closed state has changed. If it is not open, it was closed, and vice versa. This flag is only valid for project resources.TYPE- The resource (a folder or file) has changed its type.SYNC- The resource's sync status has changed.MARKERS- The resource's markers have changed.REPLACED- The resource (and all its properties) was deleted (either by a delete or move), and was subsequently re-created (either by a create, move, or copy).
REMOVED(orCHANGEDin conjunction withREPLACED):MOVED_TO- The resource has moved.getMovedToPathwill return the path of where it was moved to.
ADDED(orCHANGEDin conjunction withREPLACED):MOVED_FROM- The resource has moved.getMovedFromPathwill return the path of where it was moved from.
REMOVED, with flagMOVED_TO, andgetMovedToPathon A will return the path for B. B will have kindADDED, with flagMOVED_FROM, andgetMovedFromPathon B will return the path for A. B's other flags will describe any other changes to the resource, as compared to its previous location at A.Note that the move flags only describe the changes to a single resource; they don't necessarily imply anything about the parent or children of the resource. If the children were moved as a consequence of a subtree move operation, they will have corresponding move flags as well.
Note that it is possible for a file resource to be replaced in the workspace by a folder resource (or the other way around). The resource delta, which is actually expressed in terms of paths instead or resources, shows this as a change to either the content or children.
getFullPath
public org.eclipse.core.runtime.IPath getFullPath()
- Returns the full, absolute path of this resource delta.
Note: the returned path never has a trailing separator.
getKind
public int getKind()
- Returns the kind of this resource delta.
Normally, one of
ADDED,REMOVED,CHANGED. When phantom resources have been explicitly requested, there are two additional kinds:ADDED_PHANTOMandREMOVED_PHANTOM.
getMarkerDeltas
public IMarkerDelta[] getMarkerDeltas()
- Returns the changes to markers on the corresponding resource.
Returns an empty array if no markers changed.
getMovedFromPath
public org.eclipse.core.runtime.IPath getMovedFromPath()
- Returns the full path (in the "before" state) from which this resource
(in the "after" state) was moved. This value is only valid
if the
MOVED_FROMchange flag is set; otherwise,nullis returned.Note: the returned path never has a trailing separator.
getMovedToPath
public org.eclipse.core.runtime.IPath getMovedToPath()
- Returns the full path (in the "after" state) to which this resource
(in the "before" state) was moved. This value is only valid if the
MOVED_TOchange flag is set; otherwise,nullis returned.Note: the returned path never has a trailing separator.
getProjectRelativePath
public org.eclipse.core.runtime.IPath getProjectRelativePath()
- Returns the project-relative path of this resource delta.
Returns the empty path for projects and the workspace root.
A resource's project-relative path indicates the route from the project to the resource. Within a workspace, there is exactly one such path for any given resource. The returned path never has a trailing separator.
getResource
public IResource getResource()
- Returns a handle for the affected resource.
For additions (
ADDED), this handle describes the newly-added resource; i.e., the one in the "after" state.For changes (
CHANGED), this handle also describes the resource in the "after" state. When a file or folder resource has changed type, the former type of the handle can be inferred.For removals (
REMOVED), this handle describes the resource in the "before" state. Even though this resource would not normally exist in the current workspace, the type of resource that was removed can be determined from the handle.For phantom additions and removals (
ADDED_PHANTOMandREMOVED_PHANTOM), this is the handle of the phantom resource.
|
|||||||||
| Home >> All >> org >> eclipse >> core >> [ resources overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC