public class ResourceDiff extends TwoWayDiff implements IResourceDiff
IResourceDiff
.
This class may be subclassed by clients.
FLAG_MASK
DESCRIPTION, OPEN
Constructor and Description |
---|
ResourceDiff(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
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
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.
|
getFlags, getFromPath, getToPath
getKind, getPath, getStatus, hashCode, toDiffString
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getFlags, getFromPath, getToPath
getKind, getPath, toDiffString
public ResourceDiff(IResource resource, int kind, int flags, IFileRevision before, IFileRevision after)
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 objectpublic ResourceDiff(IResource resource, int kind)
ResourceDiff(resource, kind, 0, null, null)
resource
- a resourcekind
- the kind of change (ADDED, REMOVED or CHANGED)public IFileRevision getBeforeState()
IResourceDiff
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.getBeforeState
in interface IResourceDiff
public IFileRevision getAfterState()
IResourceDiff
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.getAfterState
in interface IResourceDiff
public IResource getResource()
IResourceDiff
getResource
in interface IResourceDiff
public boolean equals(Object obj)
equals
in class TwoWayDiff
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.