Bug 221222 - WorkbenchStatusDialog assumes that the WorkbenchWindow is open
Summary: WorkbenchStatusDialog assumes that the WorkbenchWindow is open
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 222145 (view as bug list)
Depends on: 222947
Blocks: 218360
  Show dependency tree
 
Reported: 2008-03-03 15:58 EST by Tod Creasey CLA
Modified: 2008-04-29 09:14 EDT (History)
3 users (show)

See Also:


Attachments
Workbench changes to call status management on startup (4.66 KB, patch)
2008-03-03 16:02 EST, Tod Creasey CLA
no flags Details | Diff
Fix (incorporates changes for bug 221493) (27.33 KB, patch)
2008-03-07 03:38 EST, Krzysztof Daniel CLA
no flags Details | Diff
Patch proposition (1.76 KB, patch)
2008-03-16 14:28 EDT, Krzysztof Daniel CLA
no flags Details | Diff
Another patch (4.18 KB, patch)
2008-03-17 21:40 EDT, Krzysztof Daniel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2008-03-03 15:58:05 EST
The WorkbenchStatusDialog  assumes that the shell sent to it by ProgressManagerUtil#getDefaultParent() is not null (which is is specc'ed to be if there is no parent).

As a result opening the dialog on startup will result in the following error:

!ENTRY org.eclipse.ui 4 0 2008-03-03 16:01:00.341
!MESSAGE Error occurred during status handling
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.statushandlers.WorkbenchStatusDialog.prepareImages(WorkbenchStatusDialog.java:478)
	at org.eclipse.ui.statushandlers.WorkbenchStatusDialog.<init>(WorkbenchStatusDialog.java:463)
	at org.eclipse.ui.statushandlers.WorkbenchStatusDialog.<init>(WorkbenchStatusDialog.java:499)
	at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.initStatusDialog(WorkbenchErrorHandler.java:114)
	at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.getStatusDialog(WorkbenchErrorHandler.java:81)
	at org.eclipse.ui.statushandlers.WorkbenchErrorHandler.handle(WorkbenchErrorHandler.java:63)
	at org.eclipse.ui.internal.ide.IDEWorkbenchErrorHandler.handle(IDEWorkbenchErrorHandler.java:93)
	at org.eclipse.ui.internal.WorkbenchErrorHandlerProxy.handle(WorkbenchErrorHandlerProxy.java:36)
	at org.eclipse.ui.tests.statushandlers.TestStatusHandler.handle(TestStatusHandler.java:47)
	at org.eclipse.ui.statushandlers.StatusManager.handle(StatusManager.java:181)
	at org.eclipse.ui.internal.JFaceUtil$3.show(JFaceUtil.java:69)
	at org.eclipse.jface.util.SafeRunnable.handleException(SafeRunnable.java:67)
	at org.eclipse.ui.internal.Workbench$46.handle(Workbench.java:1946)
	at org.eclipse.ui.internal.Workbench$46.access$0(Workbench.java:1945)
	at org.eclipse.ui.internal.Workbench$48.runWithException(Workbench.java:1936)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:130)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3749)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3374)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:801)
	at org.eclipse.ui.internal.Workbench$26.runWithException(Workbench.java:1368)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:130)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3749)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3374)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2283)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2193)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:476)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:471)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:77)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Comment 1 Tod Creasey CLA 2008-03-03 16:02:36 EST
Created attachment 91440 [details]
Workbench changes to call status management on startup

From Bug 218360

Steps
1) Load platfror-ui and platform-ui-tests
2) Apply patch
3) Self host
Comment 2 Krzysztof Daniel CLA 2008-03-04 04:14:03 EST
Szymon, could you assign this bug to me?
Comment 3 Krzysztof Daniel CLA 2008-03-04 07:49:30 EST
Tod,
What actually should StatusDialog do in this case? Log status? Try to display it anyway?
Comment 4 Tod Creasey CLA 2008-03-04 08:29:07 EST
This is part of a general issue of what to do on startup. Shutting down without telling the user why is not really very good - I think it should try and display it regardless.
Comment 5 Krzysztof Daniel CLA 2008-03-07 03:38:07 EST
Created attachment 91847 [details]
Fix (incorporates changes for bug 221493)
Comment 6 Tod Creasey CLA 2008-03-13 16:02:09 EDT
Me too review
Comment 7 Tod Creasey CLA 2008-03-14 09:36:47 EDT
Krystof this patch does not apply against HEAD. Could you update it please?
Comment 8 Krzysztof Daniel CLA 2008-03-16 14:28:18 EDT
Created attachment 92661 [details]
Patch proposition
Comment 9 Tod Creasey CLA 2008-03-17 10:00:06 EDT
I just looked at this and noticed that WorkbenchStatusDialog does not subclass the JFace Dialog where a lot of this sort of thing is worked out for you.

I think making it a subclass of Dialog and calling super so that you get the advantage of shell providers and a consistent look and feel should be the first step.
Comment 10 Tod Creasey CLA 2008-03-17 10:03:13 EDT
This will likely be cleared up by a fix to Bug 222947.
Comment 11 Krzysztof Daniel CLA 2008-03-17 21:40:49 EDT
Created attachment 92755 [details]
Another patch

Now I think it looks much better - I have removed almost all dependencies to the passed parent Shell and delegated preparing image to the internal dialog.
Comment 12 Tod Creasey CLA 2008-03-18 09:49:33 EDT
The patch is fine except for managing the Image yourself - it should be managed by the workbench images.

I have updated it and released the changes for build >20080318
Comment 13 Tod Creasey CLA 2008-03-27 10:44:44 EDT
Verified in I20080327-0100 by code inspection
Comment 14 Krzysztof Daniel CLA 2008-04-29 09:14:01 EDT
*** Bug 222145 has been marked as a duplicate of this bug. ***