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
});
		MenuItem menuItemAll = new MenuItem(menu, SWT.NONE);
		menuItemAll.setText(SWTRenderersMessages.menuCloseAll);
		menuItemAll.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(SelectionEvent e) {
				MPart part = (MPart) menu.getData(STACK_SELECTED_PART);
				closeSiblingEditors(part, false);
			}
		});
		return menu;
	}
	private boolean isEditor(MPart part) {
		if (part == null)
			return false;
		return part.getTags().contains("Editor"); 
	}
	private void closeSiblingEditors(MPart part, boolean skipThisPart) {
		MElementContainer<MUIElement> container = part.getParent();
		if (container == null)
			return;
		List<MUIElement> children = container.getChildren();
		List<MPart> others = new LinkedList<MPart>();
		for (MUIElement child : children) {
			MPart otherPart = null;
			if (child instanceof MPart)
				otherPart = (MPart) child;
			else if (child instanceof MPlaceholder) {
				MUIElement otherItem = ((MPlaceholder) child).getRef();
				if (otherItem instanceof MPart)
					otherPart = (MPart) otherItem;