Community
Participate
Working Groups
1. Window > Show View > Error Log 2. Detach the 'Error Log' view. 3. File > Restart 4. Reattach the 'Error Log' view to the workbench window. 5. Double-click on an entry in the log, an error will occur. May be related to bug 334411. org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4185) at org.eclipse.swt.SWT.error(SWT.java:4100) at org.eclipse.swt.SWT.error(SWT.java:4071) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:582) at org.eclipse.ui.internal.views.log.EventDetailsDialog.<init>(EventDetailsDialog.java:107) at org.eclipse.ui.internal.views.log.EventDetailsDialogAction.run(EventDetailsDialogAction.java:95) at org.eclipse.ui.internal.views.log.LogView$15.doubleClick(LogView.java:535) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1421) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:239) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:236) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4089) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3680)
Basic gist of the problem as follows: 1. Part is created and the part's shell is cached (the shell is said detached window). 2. Part is reattached to the workbench window. 3. Cached shell is no longer valid because the detached window is gone, the SWTException is thrown. Why does this work in 3.x? Because of the big lie, the controls are first created under the workbench window so the cached shell is safe (instead of being a volatile one in 4.x).
In this case I think we should modify the code in the offending view (at least we own it). I'm truly loathe to add unnecessary complexity to the rendering story in order to handle what is actually bad code in an existing part. The current rendering story makes sense (i.e. your shell is actually the shell that you're being created in) and anything else might be considered a defect in E4 apps. Why do I get created under the main shell when my part is in a detached window? The answer that the Error Log view needed it isn't sufficient...;-). If this turns out to be a common problem we can re-evaluate the approach but even then it should be limited somehow to only parts that need it or made specific to the compatibility layer.
Would like to request that PDE changes their potentially volatile code.
Created attachment 186992 [details] 'Error Log' view patch v1 Please use the attached patch to prevent the use of cached shells that may go stale.
Fixed in HEAD. Marking as FIXED as it looks like this is the only view that needs changes. Thanks Remy.
Verified in I20110126-0800