Java Code Examples for org.eclipse.compare.CompareUI#openCompareEditorOnPage()

The following examples show how to use org.eclipse.compare.CompareUI#openCompareEditorOnPage() . 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: EditConflictsAction.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * edit the conflicts using built-in merger
 * 
 * @param resource
 * @param conflictOldFile
 * @param conflictWorkingFile
 * @param conflictNewFile
 * @throws InvocationTargetException
 */
private void editConflictsInternal(IFile resource, IFile conflictOldFile,
        IFile conflictWorkingFile, IFile conflictNewFile)
        throws InvocationTargetException, InterruptedException {
    CompareConfiguration cc = new CompareConfiguration();
    ConflictsCompareInput fInput = new ConflictsCompareInput(cc);
    fInput.setResources(conflictOldFile, conflictWorkingFile,
            conflictNewFile, (IFile) resource);
    CompareUI.openCompareEditorOnPage(fInput, getTargetPage());
}
 
Example 2
Source File: BuiltInEditConflictsAction.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private void editConflictsInternal()
        throws InvocationTargetException, InterruptedException {
    CompareConfiguration cc = new CompareConfiguration();
    cc.setLeftEditable(true);
    builtInConflictsCompareInput = new BuiltInConflictsCompareInput(cc, conflictDescriptor);
    builtInConflictsCompareInput.setResources(conflictOldFile, conflictWorkingFile,
            conflictNewFile, mergedFile, fileName);
    CompareUI.openCompareEditorOnPage(builtInConflictsCompareInput, getTargetPage());
}
 
Example 3
Source File: CompareSvnPropertiesAction.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void execute(IAction action) {	
	exception = null;
	IResource[] resources = getSelectedResources();
	IPropertyProvider left = null;
	right = null;
	if (resources != null && resources.length > 0) {
		left = new PropertyCompareLocalResourceNode(resources[0], true, null);
		if (resources.length > 1) {
			right = new PropertyCompareLocalResourceNode(resources[1], true, null);
		}
		else {
			final ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[0]);
			BusyIndicator.showWhile(Display.getDefault(), new Runnable() {			
				public void run() {
					try {
						right = new PropertyCompareRemoteResourceNode(svnResource.getRemoteResource(SVNRevision.HEAD), SVNRevision.HEAD, true, null);
					} catch (SVNException e) {
						exception = e;
					}							
				}
			});
			if (exception != null) {
				MessageDialog.openError(getShell(), Policy.bind("CompareSvnPropertiesAction.0"), exception.getMessage()); //$NON-NLS-1$
				return;
			}
		}
	}
	else {
		ISVNRemoteResource[] remoteResources = getSelectedRemoteResources();
		if (remoteResources != null && remoteResources.length > 0) {
			left = new PropertyCompareRemoteResourceNode(remoteResources[0], SVNRevision.HEAD, true, null);
			if (remoteResources.length > 1) {
				right =  new PropertyCompareRemoteResourceNode(remoteResources[1], SVNRevision.HEAD, true, null);
			}
		}
	}
	ComparePropertiesDialog dialog = new ComparePropertiesDialog(getShell(), left, right);
	if (dialog.open() == ComparePropertiesDialog.OK) {
		CompareUI.openCompareEditorOnPage(dialog.getInput(), getTargetPage());
	}
}