|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.core.diff.provider.Diff
org.eclipse.team.core.diff.provider.TwoWayDiff
Implementation of ITwoWayDiff
. By default, this implementation
returns null
for the getFromPath()
and
getToPath()
. Subclasses that support move diffs
should override these methods.
This class may be subclassed by clients.
Field Summary | |
---|---|
protected static int |
FLAG_MASK
Constant (bit mask) that defines the area of the status that is reserved for use by this abstract class for encoding the flags of the diff. |
Fields inherited from class org.eclipse.team.core.diff.provider.Diff |
---|
KIND_MASK |
Fields inherited from interface org.eclipse.team.core.diff.ITwoWayDiff |
---|
CONTENT, COPY_FROM, MOVE_FROM, MOVE_TO, REPLACE |
Fields inherited from interface org.eclipse.team.core.diff.IDiff |
---|
ADD, CHANGE, NO_CHANGE, REMOVE |
Constructor Summary | |
---|---|
TwoWayDiff(IPath path,
int kind,
int flags)
Create a two-way diff |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
int |
getFlags()
Returns flags which describe in more detail how a object has been affected. |
IPath |
getFromPath()
Returns the full path (in the "before" state) from which this resource (in the "after" state) was moved. |
IPath |
getToPath()
Returns the full path (in the "after" state) to which this resource (in the "before" state) was moved. |
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 |
Field Detail |
protected static final int FLAG_MASK
FLAG_MASK
Diff.getStatus()
,
Constant Field ValuesConstructor Detail |
public TwoWayDiff(IPath path, int kind, int flags)
path
- the path of the model object that has changedkind
- the kind of changeflags
- additional flags that describe the changeMethod Detail |
public int getFlags()
ITwoWayDiff
The following codes (bit masks) are used when kind is CHANGE
, and
also when the object is involved in a move:
CONTENT
- The bytes contained by the resource have
been altered.REPLACE
- The object
was deleted (either by a delete or move), and was subsequently re-created
(either by a create, move, or copy).REMOVE
(or CHANGE
in conjunction with REPLACE
):
MOVE_TO
- The object has moved.
getToPath
will return the path of where it was moved to.ADD
(or CHANGE
in conjunction with REPLACE
):
MOVE_FROM
- The object has moved.
getFromPath
will return the path of where it was moved from.COPY_FROM
- The object has copied.
getFromPath
will return the path of where it was copied from.REMOVE
, with flag MOVE_TO
,
and getToPath
on A will return the path for B.
B will have kind ADD
, with flag MOVE_FROM
,
and getFromPath
on 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 object; they don't necessarily imply anything about the parent or children of the object. If the children were moved as a consequence of a subtree move operation, they will have corresponding move flags as well.
getFlags
in interface ITwoWayDiff
ITwoWayDiff.CONTENT
,
ITwoWayDiff.MOVE_TO
,
ITwoWayDiff.MOVE_FROM
,
ITwoWayDiff.COPY_FROM
,
ITwoWayDiff.REPLACE
,
IDiff.getKind()
,
ITwoWayDiff.getFromPath()
,
ITwoWayDiff.getToPath()
public IPath getToPath()
ITwoWayDiff
MOVE_TO
change flag is set; otherwise,
null
is returned.
Note: the returned path never has a trailing separator.
getToPath
in interface ITwoWayDiff
null
ITwoWayDiff.getFromPath()
,
IDiff.getPath()
,
ITwoWayDiff.getFlags()
public IPath getFromPath()
ITwoWayDiff
MOVE_FROM
change flag is set; otherwise,
null
is returned.
Note: the returned path never has a trailing separator.
getFromPath
in interface ITwoWayDiff
null
ITwoWayDiff.getToPath()
,
IDiff.getPath()
,
ITwoWayDiff.getFlags()
public boolean equals(Object obj)
equals
in class Diff
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.