本文整理汇总了Java中org.eclipse.ui.ide.IDE.getEditorDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java IDE.getEditorDescriptor方法的具体用法?Java IDE.getEditorDescriptor怎么用?Java IDE.getEditorDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.ide.IDE
的用法示例。
在下文中一共展示了IDE.getEditorDescriptor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openAndSelect
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
public IEditorPart openAndSelect(IWorkbenchPage wbPage, IFile file, int offset, int length, boolean activate) throws PartInitException {
String editorId= null;
IEditorDescriptor desc= IDE.getEditorDescriptor(file);
if (desc == null || !desc.isInternal()) {
editorId= "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
} else {
editorId= desc.getId();
}
IEditorPart editor;
if (NewSearchUI.reuseEditor()) {
editor= showWithReuse(file, wbPage, editorId, activate);
} else {
editor= showWithoutReuse(file, wbPage, editorId, activate);
}
if (editor instanceof ITextEditor) {
ITextEditor textEditor= (ITextEditor) editor;
textEditor.selectAndReveal(offset, length);
} else if (editor != null) {
showWithMarker(editor, file, offset, length);
}
return editor;
}
示例2: open
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
@Override
public void open() {
try {
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IEditorDescriptor editorDescriptor = IDE
.getEditorDescriptor(fStorage.getName());
IEditorPart editor = page.openEditor(new StorageEditorInput(
fStorage), editorDescriptor.getId());
selectAndReveal(editor, fHighlightRange);
} catch (PartInitException e) {
}
}
示例3: getEditorId
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
private String getEditorId(IEditorInput input) {
try {
IEditorDescriptor descriptor = IDE.getEditorDescriptor(input.getName(), true, true);
return descriptor.getId();
} catch (PartInitException e) {
return null;
}
}
示例4: testDefaultEditorBinding
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Test
public void testDefaultEditorBinding() throws Exception {
IEditorDescriptor editorDescriptor = IDE.getEditorDescriptor( fileName, true );
assertThat( editorDescriptor.getId() ).isEqualTo( ImageViewerEditor.ID );
}
示例5: getEditorID
import org.eclipse.ui.ide.IDE; //导入方法依赖的package包/类
private String getEditorID(IFile file) throws PartInitException {
IEditorDescriptor desc= IDE.getEditorDescriptor(file);
if (desc == null)
return SearchPlugin.getDefault().getWorkbench().getEditorRegistry().findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID).getId();
return desc.getId();
}