本文整理汇总了Java中org.eclipse.compare.CompareUI.openCompareEditor方法的典型用法代码示例。如果您正苦于以下问题:Java CompareUI.openCompareEditor方法的具体用法?Java CompareUI.openCompareEditor怎么用?Java CompareUI.openCompareEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.compare.CompareUI
的用法示例。
在下文中一共展示了CompareUI.openCompareEditor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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!");
}
}
示例2: 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);
}
}
示例3: compareSelectedQuickfixes
import org.eclipse.compare.CompareUI; //导入方法依赖的package包/类
private void compareSelectedQuickfixes() {
if ( selected.size() < 1 || selected.size() > 2 ) {
return;
}
// About customization
// https://eclipse.org/forums/index.php/t/781875/
ISearchState left = searcher;
ISearchState right = selected.get(0);
ISearchState ancestor = null;
if ( selected.size() == 2 ) {
left = selected.get(1);
ancestor = searcher;
}
CompareConfiguration conf = MyCompareInput.createDefaultConfiguration();
conf.setProperty(CompareConfiguration.USE_OUTLINE_VIEW, true);
MyCompareInput input = new MyCompareInput(
conf,atlResource, ancestor, left, right);
CompareUI.openCompareEditor(input);
// IStructuredSelection s = (IStructuredSelection) event.getSelection();
// selected.clear();
// s.iterator().forEachRemaining(e -> {
// if ( e instanceof ISearchState) {
// selected.add((ISearchState) e);
// }
// });
}
示例4: openCompareUI
import org.eclipse.compare.CompareUI; //导入方法依赖的package包/类
@Override
public void openCompareUI(final CompareEditorInput input) {
CompareUI.openCompareEditor(input);
}
示例5: display
import org.eclipse.compare.CompareUI; //导入方法依赖的package包/类
public void display() {
CompareUI.openCompareEditor(new ModelCompareEditorInput(snapshot), true);
}
示例6: openNewCompareEditor
import org.eclipse.compare.CompareUI; //导入方法依赖的package包/类
/**
* Opens a new compare editor with the given input.
*
* @param input
* the {@link GitFileDiffEditorInput} to be shown in the newly created compare editor
*/
public static void openNewCompareEditor(final GitFileDiffEditorInput input) {
CompareUI.openCompareEditor(input);
}