Bug 320243 Closing last view of a minimized stack makes the stack in an unstable state
I20100718-2237 1. Minimize the 'Package Explorer'. 2. Show it by clicking its icon in the trim. 3. Close it. 4. Notice that it still shows up in the trim. 5. Click on the icon. 6. An SWTException occurs. 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.getData(Widget.java:554) at org.eclipse.e4.ui.workbench.addons.minmax.TrimStack$9.widgetSelected(TrimStack.java:308)
bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/minmax/MinMaxAddon.java
void minimizeStack(MPartStack stack) {
		MTrimmedWindow window = (MTrimmedWindow) modelService.getTopLevelWindowFor(stack);
		Shell winShell = (Shell) window.getWidget();
		
		String trimId = stack.getElementId() + getMinimizedStackSuffix(stack);
		MToolControl trimStack = (MToolControl) modelService.find(trimId, window);
		if (trimStack == null) {
			trimStack = MenuFactoryImpl.eINSTANCE.createToolControl();
			trimStack.setElementId(trimId);
			trimStack.setContributionURI(trimURI);
			Rectangle winBounds = winShell.getBounds();
			int winCenterX = winBounds.width / 2;
			Control stackCtrl = (Control) stack.getWidget();
			Rectangle stackBounds = stackCtrl.getBounds();
			stackBounds = winShell.getDisplay().map(stackCtrl, winShell, stackBounds);
			int stackCenterX = stackBounds.x + (stackBounds.width / 2);
			SideValue side = stackCenterX < winCenterX ? SideValue.LEFT : SideValue.RIGHT;
			MTrimBar bar = modelService.getTrim(window, side);
			MToolControl spacer = (MToolControl) modelService.find("PerspectiveSpacer", bar);
			if (spacer != null) {
				int spacerIndex = bar.getChildren().indexOf(spacer);
				bar.getChildren().add(spacerIndex - 1, trimStack);
				Control ctrl = (Control) trimStack.getWidget();
				if (ctrl != null) {
					Control spacerCtrl = (Control) spacer.getWidget();
					ctrl.moveAbove(spacerCtrl);
				}
			} else {
				bar.getChildren().add(trimStack);
				if (!bar.isToBeRendered())