本文整理匯總了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();
}