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
ConstructorsConstructorDescriptionDiffElement(IDiffContainer parent, int kind) Creates a newDiffElementas a child of the given parent. -
Method Summary
Modifier and TypeMethodDescriptiongetImage()TheDiffElementimplementation of thisITypedInputmethod returnsnull.intgetKind()Returns the kind of difference as defined inDifferencer.Returns the parent of this element.getType()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, waitMethods inherited from interface org.eclipse.compare.ITypedElement
getName
-
Constructor Details
-
DiffElement
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 Details
-
getImage
TheDiffElementimplementation of thisITypedInputmethod returnsnull. Subclasses may re-implement to provide an image for this element.- Specified by:
getImagein interfaceITypedElement- Returns:
null.
-
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:
-
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
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
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
-