org.eclipse.team.core.mapping.provider
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, IResourceDiff, ITwoWayDiff
- public class ResourceDiff
- extends TwoWayDiff
- implements IResourceDiff
Implementation of IResourceDiff
.
This class may be subclassed by clients.
- Since:
- 3.2
Fields inherited from class org.eclipse.team.core.diff.provider.Diff |
KIND_MASK |
Method Summary |
IFileRevision |
getAfterState()
Return a handle to the file state representing the "after" state
of the file used to calculate this diff. |
IFileRevision |
getBeforeState()
Return a handle to the file state representing the "before" state
of the file used to calculate this diff. |
IResource |
getResource()
Return the local resource to which this diff applies. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
public ResourceDiff(IResource resource,
int kind)
- Convenience constructor for creating a simple folder diff
that consists of a resource and a kind only. It is equivalent to
ResourceDiff(resource, kind, 0, null, null)
- Parameters:
resource
- a resourcekind
- the kind of change (ADDED, REMOVED or CHANGED)
getBeforeState
public IFileRevision 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. A
null
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 the IFileState.exists()
method to see if the file
existed in the before state.
- Specified by:
getBeforeState
in interface IResourceDiff
- Returns:
- a handle to the file state representing the "before" state
used to calculate this diff
getAfterState
public IFileRevision 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. A
null
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 the IFileState.exists()
method to see if the file
existed in the after state.
- Specified by:
getAfterState
in interface IResourceDiff
- Returns:
- a handle to the file state representing the "before" state
used to calculate this diff
getResource
public IResource getResource()
- Description copied from interface:
IResourceDiff
- Return the local resource to which this diff applies.
- Specified by:
getResource
in interface IResourceDiff
- Returns:
- the local resource to which this diff applies
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.