
org.eclipse.compare.structuremergeviewer.IDiffElement Maven / Gradle / Ivy
Show all versions of org.eclipse.compare Show documentation
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.compare.structuremergeviewer;
import org.eclipse.compare.ITypedElement;
/**
* An IDiffElement
is used in the DiffTreeViewer
* to display the kind of change detected as the result of a two-way or three-way compare.
*
* The base interface ITypedElement
provides a name, a type, and an image.
* IDiffElement
adds API for maintaining a parent relationship.
*
* DiffTreeViewer
works on a tree of IDiffElements
.
* Leaf elements must implement the
* IDiffElement
interface, inner nodes the IDiffContainer
interface.
*
* IDiffElement
s are typically created as the result of performing
* a compare with the Differencer
.
*
* Clients may implement this interface, or use one of the standard implementations,
* DiffElement
, DiffContainer
, or DiffNode
.
*
* @see DiffTreeViewer
* @see DiffElement
* @see DiffContainer
* @see DiffNode
*/
public interface IDiffElement extends ITypedElement {
/**
* Returns the kind of difference as defined in Differencer
.
*
* @return the kind of difference as defined in Differencer
*/
int getKind();
/**
* Returns the parent of this element.
* If the object is the root of a hierarchy null
is returned.
*
* @return the parent of this element, or null
if the element has no parent
*/
IDiffContainer getParent();
/**
* Sets the parent of this element.
*
* @param parent the new parent of this element, or null
if this
* element is to have no parent
*/
void setParent(IDiffContainer parent);
}