org.eclipse.ui.PartInitException: Unable to open editor, unknown editor ID 错误
Eclipse3.2M6以后,Editor在plugin.xml里注册时,必须带icon参数
<extension
id="gef.tutorial.step.ui.DiagramEditor">
<editor
id="gef.tutorial.step.ui.DiagramEditor"
name="Diagram Editor"
icon=""
class="gef.tutorial.step.ui.DiagramEditor"
default="false">
</editor>
</extension>
在对应action中得run函数中打开编辑器.
IEditorInput input = new DiagramEditorInput(new Path(path));
IWorkbenchPage page = window.getActivePage();
try {
page.openEditor(input, DiagramEditor.ID, true);
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}