Class DiffElement
java.lang.Object
org.eclipse.compare.structuremergeviewer.DiffElement
- All Implemented Interfaces:
ITypedElement
,IDiffElement
- Direct Known Subclasses:
DiffContainer
An abstract base implementation of the
IDiffElement
interface.
Subclasses may add behavior and state, and may override getImage
and getType
to suit.
-
Field Summary
Fields inherited from interface org.eclipse.compare.ITypedElement
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
-
Constructor Summary
ConstructorDescriptionDiffElement
(IDiffContainer parent, int kind) Creates a newDiffElement
as a child of the given parent. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()
TheDiffElement
implementation of thisITypedInput
method returnsnull
.int
getKind()
Returns the kind of difference as defined inDifferencer
.Returns the parent of this element.getType()
TheDiffElement
implementation of thisITypedElement
method returnsITypedElement.UNKNOWN_TYPE
.void
setKind
(int kind) Sets the kind of difference for this element.void
setParent
(IDiffContainer parent) Sets the parent of this element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.compare.ITypedElement
getName
-
Constructor Details
-
DiffElement
Creates a newDiffElement
as a child of the given parent. If parent is notnull
the new element is added to the parent.- Parameters:
parent
- the parent of this child; if notnull
this element is automatically added as a childkind
- the kind of change
-
-
Method Details
-
getImage
TheDiffElement
implementation of thisITypedInput
method returnsnull
. Subclasses may re-implement to provide an image for this element.- Specified by:
getImage
in interfaceITypedElement
- Returns:
null
.
-
getType
TheDiffElement
implementation of thisITypedElement
method returnsITypedElement.UNKNOWN_TYPE
. Subclasses may re-implement to provide a type for this element.- Specified by:
getType
in interfaceITypedElement
- Returns:
ITypedElement.UNKNOWN_TYPE
.
-
setKind
public void setKind(int kind) Sets the kind of difference for this element.- Parameters:
kind
- set the kind of difference this element represents- See Also:
-
getKind
public int getKind()Description copied from interface:IDiffElement
Returns the kind of difference as defined inDifferencer
.- Specified by:
getKind
in interfaceIDiffElement
- Returns:
- the kind of difference as defined in
Differencer
-
getParent
Description copied from interface:IDiffElement
Returns the parent of this element. If the object is the root of a hierarchynull
is returned.- Specified by:
getParent
in interfaceIDiffElement
- Returns:
- the parent of this element, or
null
if the element has no parent
-
setParent
Description copied from interface:IDiffElement
Sets the parent of this element.- Specified by:
setParent
in interfaceIDiffElement
- Parameters:
parent
- the new parent of this element, ornull
if this element is to have no parent
-