Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 129765 - [EditorMgmt] Creating a new editor in RCP does not work without an icon!
Summary: [EditorMgmt] Creating a new editor in RCP does not work without an icon!
Status: RESOLVED DUPLICATE of bug 65731
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P4 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Kim Horne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 131434 132916 138374 184287 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-28 08:02 EST by Auerliano CLA
Modified: 2007-04-30 17:44 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Auerliano CLA 2006-02-28 08:02:08 EST
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.
Comment 1 Wassim Melhem CLA 2006-02-28 09:36:39 EST
Platform/Text owns the schema for the org.eclipse.ui.editors extension point.
Comment 2 Dani Megert CLA 2006-02-28 09:41:45 EST
Not really ;-)
Comment 3 Auerliano CLA 2006-03-01 11:49:32 EST
Well, what's the outcome then?
Comment 4 Douglas Pollock CLA 2006-03-01 11:53:31 EST
Can you please attach the exception stack trace?
Comment 5 Auerliano CLA 2006-03-01 11:59:14 EST
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)
Comment 6 Douglas Pollock CLA 2006-03-01 12:02:57 EST
Which version of Eclipse are you using?
Comment 7 Auerliano CLA 2006-03-01 12:19:40 EST
Version: 3.2.0 (As it appears above)
Build id: I20051215-1506
Comment 8 Eric Moffatt CLA 2006-03-01 14:35:24 EST
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...;-).
Comment 9 Douglas Pollock CLA 2006-03-02 14:09:41 EST
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?
Comment 10 Tom Hofmann CLA 2006-03-03 01:07:51 EST
(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.
Comment 11 Auerliano CLA 2006-03-03 05:47:10 EST
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.
Comment 12 Douglas Pollock CLA 2006-03-06 13:53:35 EST
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.
Comment 13 Wassim Melhem CLA 2006-03-11 15:09:48 EST
*** Bug 131434 has been marked as a duplicate of this bug. ***
Comment 14 Wassim Melhem CLA 2006-03-22 22:21:09 EST
*** Bug 132916 has been marked as a duplicate of this bug. ***
Comment 15 Michael Van Meekeren CLA 2006-04-21 13:19:02 EDT
Moving Dougs bugs
Comment 16 Wassim Melhem CLA 2006-04-25 11:16:54 EDT
*** Bug 138374 has been marked as a duplicate of this bug. ***
Comment 17 Wassim Melhem CLA 2007-04-26 13:58:16 EDT
*** Bug 184287 has been marked as a duplicate of this bug. ***
Comment 18 Wassim Melhem CLA 2007-04-26 14:00:29 EDT
Now that Sanjaya is no longer on American Idol, maybe Kim should celebrate by fixing this bug :)
Comment 19 Kim Horne CLA 2007-04-26 14:15:32 EDT
Mmm no. :)
Comment 20 Kim Horne CLA 2007-04-26 14:15:42 EDT

*** This bug has been marked as a duplicate of bug 65731 ***