Class ResourceDiff
java.lang.Object
org.eclipse.team.core.diff.provider.Diff
org.eclipse.team.core.diff.provider.TwoWayDiff
org.eclipse.team.core.mapping.provider.ResourceDiff
- All Implemented Interfaces:
IDiff
,ITwoWayDiff
,IResourceDiff
Implementation of
IResourceDiff
.
This class may be subclassed by clients.
- Since:
- 3.2
-
Field Summary
Fields inherited from class org.eclipse.team.core.diff.provider.TwoWayDiff
FLAG_MASK
Fields inherited from interface org.eclipse.team.core.mapping.IResourceDiff
DESCRIPTION, OPEN
-
Constructor Summary
ConstructorDescriptionResourceDiff
(IResource resource, int kind) Convenience constructor for creating a simple folder diff that consists of a resource and a kind only.ResourceDiff
(IResource resource, int kind, int flags, IFileRevision before, IFileRevision after) Create a two-way resource diff -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return a handle to the file state representing the "after" state of the file used to calculate this diff.Return a handle to the file state representing the "before" state of the file used to calculate this diff.Return the local resource to which this diff applies.Methods inherited from class org.eclipse.team.core.diff.provider.TwoWayDiff
getFlags, getFromPath, getToPath
Methods inherited from class org.eclipse.team.core.diff.provider.Diff
getKind, getPath, getStatus, hashCode, toDiffString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.team.core.diff.IDiff
getKind, getPath, toDiffString
Methods inherited from interface org.eclipse.team.core.diff.ITwoWayDiff
getFlags, getFromPath, getToPath
-
Constructor Details
-
ResourceDiff
public ResourceDiff(IResource resource, int kind, int flags, IFileRevision before, IFileRevision after) Create a two-way resource diff- Parameters:
resource
- the resourcekind
- the kind of change (ADDED, REMOVED or CHANGED)flags
- additional flags that describe the changebefore
- the before state of the model objectafter
- the after state of the model object
-
ResourceDiff
Convenience constructor for creating a simple folder diff that consists of a resource and a kind only. It is equivalent toResourceDiff(resource, kind, 0, null, null)
- Parameters:
resource
- a resourcekind
- the kind of change (ADDED, REMOVED or CHANGED)
-
-
Method Details
-
getBeforeState
Description copied from interface:IResourceDiff
Return a handle to the file state representing the "before" state of the file used to calculate this diff. Anull
is returned if the resource is not a file or if the file does not exist in the before state. If a file state is returned, clients should still check theIFileState.exists()
method to see if the file existed in the before state.- Specified by:
getBeforeState
in interfaceIResourceDiff
- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getAfterState
Description copied from interface:IResourceDiff
Return a handle to the file state representing the "after" state of the file used to calculate this diff. Anull
is returned if the resource is not a file or if the file does not exist in the after state. If a file state is returned, clients should still check theIFileState.exists()
method to see if the file existed in the after state.- Specified by:
getAfterState
in interfaceIResourceDiff
- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getResource
Description copied from interface:IResourceDiff
Return the local resource to which this diff applies.- Specified by:
getResource
in interfaceIResourceDiff
- Returns:
- the local resource to which this diff applies
-
equals
- Overrides:
equals
in classTwoWayDiff
-