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_MASKFields inherited from interface org.eclipse.team.core.mapping.IResourceDiff
DESCRIPTION, OPEN -
Constructor Summary
ConstructorsConstructorDescriptionResourceDiff(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 TypeMethodDescriptionbooleanReturn 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, getToPathMethods inherited from class org.eclipse.team.core.diff.provider.Diff
getKind, getPath, getStatus, hashCode, toDiffStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.team.core.diff.IDiff
getKind, getPath, toDiffStringMethods 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:IResourceDiffReturn a handle to the file state representing the "before" state of the file used to calculate this diff. Anullis 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:
getBeforeStatein interfaceIResourceDiff- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getAfterState
Description copied from interface:IResourceDiffReturn a handle to the file state representing the "after" state of the file used to calculate this diff. Anullis 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:
getAfterStatein interfaceIResourceDiff- Returns:
- a handle to the file state representing the "before" state used to calculate this diff
-
getResource
Description copied from interface:IResourceDiffReturn the local resource to which this diff applies.- Specified by:
getResourcein interfaceIResourceDiff- Returns:
- the local resource to which this diff applies
-
equals
- Overrides:
equalsin classTwoWayDiff
-