Bug 323046 SWTException thrown when showing context menu on an editor tab after having shown it in another window that's been closed
1. Open a file. 2. Right-click on the tab > Close 3. Window > New Window 4. Go back to the original window. Close it. 6. Open a file. 7. Right-click on the tab. org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340) at org.eclipse.swt.widgets.Widget.setData(Widget.java:1219) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.openMenuFor(StackRenderer.java:581) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$7(StackRenderer.java:578) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$6.menuDetected(StackRenderer.java:572) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:178) 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.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.showMenu(Widget.java:1463) at org.eclipse.swt.widgets.Widget.wmContextMenu(Widget.java:1559) at org.eclipse.swt.widgets.Control.WM_CONTEXTMENU(Control.java:4301) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4164) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454) at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80) at org.eclipse.swt.widgets.Widget.wmRButtonUp(Widget.java:2380) at org.eclipse.swt.widgets.Control.WM_RBUTTONUP(Control.java:4774) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4227) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:724)
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/StackRenderer.java
ctrl.setParent(ctf);
			cti.setControl(ctrl);
		} else if (element.getWidget() == null) {
			Control tabCtrl = (Control) renderer.createGui(element);
			cti.setControl(tabCtrl);
		}
		ignoreTabSelChanges = true;
		ctf.setSelection(cti);
		ignoreTabSelChanges = false;
		
		if (ctf.getTopRight() != null) {
			Control curTB = ctf.getTopRight();
			ctf.setTopRight(null);
			if (!curTB.isDisposed()) {
				MUIElement tbME = (MUIElement) curTB
						.getData(AbstractPartRenderer.OWNING_ME);
				if (tbME instanceof MRenderedToolBar)
					renderer.removeGui(tbME);
				else
					curTB.dispose();
			}
		}
		
		MPart part = (MPart) ((element instanceof MPart) ? element
				: ((MPlaceholder) element).getRef());
		MMenu viewMenu = getViewMenu(part);
		MToolBar toolbar = part.getToolbar();
		if (toolbar == null) {
			if (viewMenu != null) {
				MRenderedToolBar rtb = MenuFactoryImpl.eINSTANCE