Class DiffElement
- java.lang.Object
-
- org.eclipse.compare.structuremergeviewer.DiffElement
-
- All Implemented Interfaces:
ITypedElement
,IDiffElement
- Direct Known Subclasses:
DiffContainer
public abstract class DiffElement extends Object implements IDiffElement
An abstract base implementation of theIDiffElement
interface.Subclasses may add behavior and state, and may override
getImage
andgetType
to suit.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.compare.ITypedElement
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
-
-
Constructor Summary
Constructors Constructor Description DiffElement(IDiffContainer parent, int kind)
Creates a newDiffElement
as a child of the given parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Image
getImage()
TheDiffElement
implementation of thisITypedInput
method returnsnull
.int
getKind()
Returns the kind of difference as defined inDifferencer
.IDiffContainer
getParent()
Returns the parent of this element.String
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 Detail
-
DiffElement
public DiffElement(IDiffContainer parent, int kind)
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 Detail
-
getImage
public Image 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
public String 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:
Differencer
-
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
public IDiffContainer 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
public void setParent(IDiffContainer parent)
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
-
-