Community
Participate
Working Groups
Build ID: 3.4.1 GA Steps To Reproduce: 1. Launch attached RCP application 2. Ctrl+N (New wizard) 3. Select "Untitled Text File", press Finish 4. Add some text to the new "Untitled 1" text editor 5. Ctrl+S (Save) 6. "Saved Failed" java.lang.NullPointerException More information: SaveAsDialog uses an IDE internal image descriptor key that is only available when the IDE application is started. Can that image be made public? Or is there any other suggestion?
Created attachment 117283 [details] test case plug-in (rcp app) project
Could you please attach the full stack trace of the NPE? PW
Created attachment 117371 [details] stack trace This stack trace is from the .log file which should be reproducible as described above.
The short term workaround is for your WorkbenchAdvisor to register the same image using org.eclipse.ui.application.IWorkbenchConfigurer.declareImage(String, ImageDescriptor, boolean) org.eclipse.ui.internal.ide.IDEInternalWorkbenchImages.IMG_DLGBAN_SAVEAS_DLG is the constant to use, and the iamge can be found in org.eclipse.ui.ide at $nl$/icons/full/wizban/saveas_wiz.png This is all internal, through, and not a long term solution. As part of this bug we should at least protect against the NPE PW
Paul, Declaring the images in the ide.application doesn't seem the right way to go. They cannot be used in RCP applications where the ide.application isn't running. Moving that to ide plugin will make sense?
They're actually in org.eclipse.ui.ide. The difference seems to be that while the shared images of org.eclipse.ui.workbench are simply added when the plugin is started, the shared images of org.eclipse.ui.ide are added by the IDE workbench advisor. So a different advisor (for an RCP app) doesn't have access to the correct information (unless they subclass the IDE workbench advisor, an internal class). One solution would be to make org.eclipse.ui.ide register the images on plugin start instead of using the advisor. Nick, Boris, do you think this change in behaviour would cause downstream problems? PW
(In reply to comment #6) > Nick, Boris, do you think this change in behaviour would cause downstream > problems? I don't see a lot of problems, but I just thought I would ask. PW
Let's protect against the NPE and then decide what to do about the registration. PW
Created attachment 122819 [details] Patch v01 (In reply to comment #8) > Let's protect against the NPE and then decide what to do about the > registration. > > PW Done.
Released to HEAD >20090118 PW
Verified in I20090126-1800
Thanks for the workaround and the fix. Is there a bug to track the registration issue? I'd like to follow it so I can remove my use of internal constants.
(In reply to comment #12) > Thanks for the workaround and the fix. Is there a bug to track the > registration issue? I'd like to follow it so I can remove my use of internal > constants. > This is covered off by bug 186891 (still tryin' to decide what to do :-) PW