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 theIDiffElementinterface.Subclasses may add behavior and state, and may override
getImageandgetTypeto 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 newDiffElementas a child of the given parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImagegetImage()TheDiffElementimplementation of thisITypedInputmethod returnsnull.intgetKind()Returns the kind of difference as defined inDifferencer.IDiffContainergetParent()Returns the parent of this element.StringgetType()TheDiffElementimplementation of thisITypedElementmethod returnsITypedElement.UNKNOWN_TYPE.voidsetKind(int kind)Sets the kind of difference for this element.voidsetParent(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 newDiffElementas a child of the given parent. If parent is notnullthe new element is added to the parent.- Parameters:
parent- the parent of this child; if notnullthis element is automatically added as a childkind- the kind of change
-
-
Method Detail
-
getImage
public Image getImage()
TheDiffElementimplementation of thisITypedInputmethod returnsnull. Subclasses may re-implement to provide an image for this element.- Specified by:
getImagein interfaceITypedElement- Returns:
null.
-
getType
public String getType()
TheDiffElementimplementation of thisITypedElementmethod returnsITypedElement.UNKNOWN_TYPE. Subclasses may re-implement to provide a type for this element.- Specified by:
getTypein 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:IDiffElementReturns the kind of difference as defined inDifferencer.- Specified by:
getKindin interfaceIDiffElement- Returns:
- the kind of difference as defined in
Differencer
-
getParent
public IDiffContainer getParent()
Description copied from interface:IDiffElementReturns the parent of this element. If the object is the root of a hierarchynullis returned.- Specified by:
getParentin interfaceIDiffElement- Returns:
- the parent of this element, or
nullif the element has no parent
-
setParent
public void setParent(IDiffContainer parent)
Description copied from interface:IDiffElementSets the parent of this element.- Specified by:
setParentin interfaceIDiffElement- Parameters:
parent- the new parent of this element, ornullif this element is to have no parent
-
-