当前位置: 首页>>代码示例>>Java>>正文


Java CompareUI类代码示例

本文整理汇总了Java中org.eclipse.compare.CompareUI的典型用法代码示例。如果您正苦于以下问题:Java CompareUI类的具体用法?Java CompareUI怎么用?Java CompareUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CompareUI类属于org.eclipse.compare包,在下文中一共展示了CompareUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: displayComparisonView

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
/**
 * Display comparison view of test file with expected and actual xpect expectation
 */
private void displayComparisonView(ComparisonFailure cf, Description desc) {
	IXpectURIProvider uriProfider = XpectRunner.INSTANCE.getUriProvider();
	IFile fileTest = null;
	if (uriProfider instanceof N4IDEXpectTestURIProvider) {
		N4IDEXpectTestURIProvider fileCollector = (N4IDEXpectTestURIProvider) uriProfider;
		fileTest = ResourcesPlugin.getWorkspace().getRoot()
				.getFileForLocation(new Path(fileCollector.findRawLocation(desc)));
	}

	if (fileTest != null && fileTest.isAccessible()) {
		N4IDEXpectCompareEditorInput inp = new N4IDEXpectCompareEditorInput(fileTest, cf);
		CompareUI.openCompareEditor(inp);
	} else {
		throw new RuntimeException("paths in descriptions changed!");
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:XpectCompareCommandHandler.java

示例2: openCompareUI

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
@Override
public void openCompareUI(final CompareEditorInput input) {
    boolean legacy = true;

    try {
        CompareEditorInput.class.getDeclaredMethod("okPressed", (Class[]) null); //$NON-NLS-1$
        legacy = false;
    } catch (final Exception e) {
    }

    if (legacy) {
        CompatibleCompareUI.openCompareDialog(input);
    } else {
        /*
         * The Eclipse compare dialog can be used with 3.3 and higher
         * since it was fixed.
         */
        CompareUI.openCompareDialog(input);
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:CompareUIType.java

示例3: getImage

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
public Image getImage(Image base, int kind) {

		Object key= base;

//		kind &= 15;

		Image[] a= (Image[]) fgMap.get(key);
		if (a == null) {
			a= new Image[15];
			fgMap.put(key, a);
		}
		Image b= a[kind];
		if (b == null) {
			boolean onLeft = kind == PROPERTY_CHANGE;
			b= new DiffImage(base, fgImages[kind], 22, onLeft).createImage();
			CompareUI.disposeOnShutdown(b);
			a[kind]= b;
		}
		return b;
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:MergeResultsDecorator.java

示例4: getImage

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
public Image getImage(Image base, int kind) {

		Object key= base;

//		kind &= 3;

		Image[] a= (Image[]) fgMap.get(key);
		if (a == null) {
			a= new Image[6];
			fgMap.put(key, a);
		}
		Image b= a[kind];
		if (b == null) {
			boolean onLeft = kind == PROPERTY_CHANGE;
			b= new DiffImage(base, fgImages[kind], 22, onLeft).createImage();
			CompareUI.disposeOnShutdown(b);
			a[kind]= b;
		}
		return b;
	}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:21,代码来源:ResourceSelectionTreeDecorator.java

示例5: openInCompare

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
private void openInCompare(ITypedElement ancestor, ITypedElement left,
		ITypedElement right) {
	IWorkbenchPage workBenchPage = getTargetPage();
	CompareEditorInput input = new SaveablesCompareEditorInput(ancestor,
			left, right, workBenchPage);
	IEditorPart editor = CompareRevisionAction.findReusableCompareEditor(
			input, workBenchPage);
	if (editor != null) {
		IEditorInput otherInput = editor.getEditorInput();
		if (otherInput.equals(input)) {
			// simply provide focus to editor
			workBenchPage.activate(editor);
		} else {
			// if editor is currently not open on that input either re-use
			// existing
			CompareUI.reuseCompareEditor(input, (IReusableEditor) editor);
			workBenchPage.activate(editor);
		}
	} else {
		CompareUI.openCompareEditor(input);
	}
}
 
开发者ID:sakim,项目名称:eclipse-utility,代码行数:23,代码来源:OpenComparablesHandler.java

示例6: editConflictsInternal

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
private void editConflictsInternal()
        throws InvocationTargetException, InterruptedException {
    CompareConfiguration cc = new CompareConfiguration();
    cc.setLeftEditable(true);
    mergeConflictsCompareInput = new MergeConflictsCompareInput(cc, conflictDescriptor);
    mergeConflictsCompareInput.setMergeResult(mergeResult);
    mergeConflictsCompareInput.setResources(conflictOldFile, conflictWorkingFile,
            conflictNewFile, mergedFile, fileName);
    CompareUI.openCompareEditorOnPage(mergeConflictsCompareInput, getTargetPage());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:11,代码来源:MergeEditConflictsAction.java

示例7: getImage

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
public Image getImage(Image base) {
	Image decoratedImage = (Image) fgMap.get(base);
	if (decoratedImage != null) {
		return decoratedImage;
	}
	decoratedImage = new DiffImage(base, locked, 18, false).createImage();
	fgMap.put(base, decoratedImage);
	CompareUI.disposeOnShutdown(decoratedImage);
	return decoratedImage;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:11,代码来源:RepositoriesViewDecorator.java

示例8: editConflictsInternal

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:EditConflictsAction.java

示例9: editConflictsInternal

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
/**
   * 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();
      final ConflictsCompareInput fInput = new ConflictsCompareInput(cc);
      fInput.setResources(conflictOldFile, conflictWorkingFile,
              conflictNewFile, (IFile) resource);
getShell().getDisplay().syncExec(new Runnable() {
	public void run() {
	    CompareUI.openCompareEditorOnPage(fInput, getPart().getSite().getPage());
	}
});        
  }
 
开发者ID:subclipse,项目名称:subclipse,代码行数:23,代码来源:EditConflictsSynchronizeOperation.java

示例10: getString

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
public static String getString(String key) {
	try {
		return CompareUI.getResourceBundle().getString(key);
	} catch (MissingResourceException e) {
		return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
	}
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:8,代码来源:Utilities.java

示例11: getFormattedString

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
public static String getFormattedString(String key, String arg) {
	try {
		return MessageFormat.format(CompareUI.getResourceBundle().getString(key), new String[] { arg });
	} catch (MissingResourceException e) {
		return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
	}	
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:8,代码来源:Utilities.java

示例12: editConflictsInternal

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
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());
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:10,代码来源:BuiltInEditConflictsAction.java

示例13: openExistingCompareEditor

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
/**
 * Displays the given input in an existing compare editor, if there is already one. Otherwise, a new compare editor is
 * opened.
 * 
 * @param input
 *          the {@link GitFileDiffEditorInput} to be shown in the compare editor
 */
public static void openExistingCompareEditor(final GitFileDiffEditorInput input) {
  final IEditorPart existingEditor = findExistingCompareEditor();
  if (existingEditor != null) {
    CompareUI.reuseCompareEditor(input, (IReusableEditor) existingEditor);
    WorkbenchUtil.activePage().activate(existingEditor);
  }
  else {
    openNewCompareEditor(input);
  }
}
 
开发者ID:sealuzh,项目名称:Permo,代码行数:18,代码来源:CompareUtil.java

示例14: getStructure

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
/**
 * @param input implement the IStreamContentAccessor interface
 * @return a tree of JavaNodes for the given input.
 * In case of error null is returned.
 */
@Override
public IStructureComparator getStructure(final Object input) {
	String contents= null;
	char[] buffer= null;
	IDocument doc= CompareUI.getDocument(input);
	if (doc == null) {
		if (input instanceof IStreamContentAccessor) {
			IStreamContentAccessor sca= (IStreamContentAccessor) input;
			try {
				contents= JavaCompareUtilities.readString(sca);
			} catch (CoreException ex) {
				// return null indicates the error.
				return null;
			}
		}

		if (contents != null) {
			int n= contents.length();
			buffer= new char[n];
			contents.getChars(0, n, buffer, 0);

			doc= new Document(contents);
			setupDocument(doc);
		}
	}

	return createStructureComparator(input, buffer, doc, null, null);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:34,代码来源:JavaStructureCreator.java

示例15: run

import org.eclipse.compare.CompareUI; //导入依赖的package包/类
@Override
public void run(ISelection selection) {

	IMember input= getEditionElement(selection);
	if (input == null) {
		MessageDialog.openInformation(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_invalidSelectionMessage);
		return;
	}

	JavaElementHistoryPageSource pageSource = JavaElementHistoryPageSource.getInstance();
	final IFile file= pageSource.getFile(input);
	if (file == null) {
		MessageDialog.openError(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_internalErrorMessage);
		return;
	}

	if (USE_MODAL_COMPARE) {
		CompareConfiguration cc = new CompareConfiguration();
		cc.setLeftEditable(false);
		cc.setRightEditable(false);
		HistoryPageCompareEditorInput ci = new HistoryPageCompareEditorInput(cc, pageSource, input);
		ci.setTitle(CompareMessages.JavaCompareWithEditionActionImpl_0);
		ci.setHelpContextId(IJavaHelpContextIds.COMPARE_ELEMENT_WITH_HISTORY_DIALOG);
		CompareUI.openCompareDialog(ci);
	} else {
		TeamUI.showHistoryFor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(), input, pageSource);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:JavaCompareWithEditionActionImpl.java


注:本文中的org.eclipse.compare.CompareUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。