Java Code Examples for org.eclipse.compare.structuremergeviewer.DiffNode#add()

The following examples show how to use org.eclipse.compare.structuremergeviewer.DiffNode#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SVNCompareRevisionsInput.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
    * Runs the compare operation and returns the compare result.
    */
protected Object prepareInput(IProgressMonitor monitor){
	initLabels();
	DiffNode diffRoot = new DiffNode(Differencer.NO_CHANGE);
	String localCharset = Utilities.getCharset(resource);
	for (int i = 0; i < logEntries.length; i++) {		
		ITypedElement left = new TypedBufferedContent(resource);
		ResourceRevisionNode right = new ResourceRevisionNode(logEntries[i]);
		try {
			right.setCharset(localCharset);
		} catch (CoreException e) {
		}
		diffRoot.add(new VersionCompareDiffNode(left, right));
	}
	return diffRoot;		
}
 
Example 2
Source File: BonitaCompareEditorInput.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private DiffNode buildPathNodes(final EObject container, final DiffNode node) {
    final DiffNode parentNode = new DiffNode(Differencer.NO_CHANGE);
    node.setParent(parentNode);
    parentNode.add(node);
    final EObjectNode ancestor = new EObjectNode(container, adapterFactoryLabelProvider);
    parentNode.setAncestor(ancestor);
    if (insertParentNode(parentNode)) {
        return parentNode;
    }
    if (container instanceof Pool) {
        return parentNode;
    }
    if (container instanceof ConnectorParameter) {
        return buildPathNodes(container.eContainer().eContainer(), parentNode);
    }
    return buildPathNodes(container.eContainer(), parentNode);
}
 
Example 3
Source File: BonitaCompareEditorInput.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
private void addChildrenToParent(final DiffNode parent, final IDiffElement[] children) {
    for (final IDiffElement child : children) {
        parent.add(child);
    }
}