Community
Participate
Working Groups
Trying creating a new editor in RCP, when no icon is assigned to the editor, ends up with: org.eclipse.ui.PartInitException: Unable to open editor, unknown editor ID: <editor id> Adding an icon to the editor in plugin.xml eliminates this problem, however, an icon is not a mandatory field for defining an editor extension.
Platform/Text owns the schema for the org.eclipse.ui.editors extension point.
Not really ;-)
Well, what's the outcome then?
Can you please attach the exception stack trace?
org.eclipse.ui.PartInitException: Unable to open editor, unknown editor ID: org.example.ExampleEditor at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:630) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2381) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2316) at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2308) at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2294) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2289) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2266) at org.example.ExampleEditorAction.run(PulseEditorAction.java:24) at org.eclipse.jface.action.Action.runWithEvent(Action.java:492) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:530) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:480) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:392) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:914) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3285) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2905) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1762) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1726) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:397) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.example.Application.run(Application.java:18) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
Which version of Eclipse are you using?
Version: 3.2.0 (As it appears above) Build id: I20051215-1506
Doug, Since the 'openEditor' method throws this when 'findEditor' returns null and all it does is look it up in a map it looks like the extension reader is choking when there's no icon (causing it to 'skip' that editor and not register it with the map). Just a guess...;-).
The documentation for the "icon" attribute on an editor says: "An icon is not required if you specify a command rather than a class." The contrapositive of this statement is "If you specify a class rather than a command, then an icon is required". (Admittedly, this is implied by the text, and not very clearly either.) Did you specify a class for the editor?
(In reply to comment #9) > The documentation for the "icon" attribute on an editor says: "An icon is not > required if you specify a command rather than a class." The contrapositive of > this statement is "If you specify a class rather than a command, then an icon > is required". (Admittedly, this is implied by the text, and not very clearly > either.) The wording may not be optimal, but it's clear enough to find out, and the message in the console also points to the problem quickly - however, I think requiring an icon is an unnecessary limitation. There would be no harm done if a default icon or the red square gets used for editors not specifying one. This is an enhancement request to remove that requirement. Not major for me anyway, but making tutorials much easier: With this fixed, one can contribute an editor by only editing the plug-in manifest.
I did specify an editor class, however as Tom mentioned, an icon should not be a mandatory field. Another similar problem is with a mandatory tooltip for the editor input submitted at https://bugs.eclipse.org/bugs/show_bug.cgi?id=130114 . If you want to keep these fields mandatory, at least produce a 'straight' message saying directly that the icon or the tooltip is missing.
Auerliano: There should be a message in your log saying: "Required attribute 'icon' not defined". I'll leave this bug open to cover the possibility of making the icon attribute optional.
*** Bug 131434 has been marked as a duplicate of this bug. ***
*** Bug 132916 has been marked as a duplicate of this bug. ***
Moving Dougs bugs
*** Bug 138374 has been marked as a duplicate of this bug. ***
*** Bug 184287 has been marked as a duplicate of this bug. ***
Now that Sanjaya is no longer on American Idol, maybe Kim should celebrate by fixing this bug :)
Mmm no. :)
*** This bug has been marked as a duplicate of bug 65731 ***