Bug 327522 Several main menus gone
I20101007-1949. 1. start new workspace 2. paste this snippet into Package Explorer: "class A {}" 3. close the editor (doesn't matter if you save or not) ==> several main menus (e.g. 'Refactor') are gone. ==> selecting another element in the view does not bring it back Nothing in .log.
bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java
parent = modelService.findPlaceholderFor(getWindow(), part).getParent();
			}
			MUIElement oldSelectedElement = parent.getSelectedElement();
			modelService.bringToTop(part);
			if (oldSelectedElement != part && parent.getChildren().contains(part)
					&& parent instanceof MGenericStack<?>) {
				internalFixContext(part, oldSelectedElement);
			}
		}
	}
	private IEclipseContext getSubContext(MUIElement element) {
		if (element instanceof MContext) {
			return ((MContext) element).getContext();
		} else if (element instanceof MElementContainer<?>) {
			Object selectedElement = ((MElementContainer<?>) element).getSelectedElement();
			if (selectedElement instanceof MContext) {
				return ((MContext) selectedElement).getContext();
			} else if (selectedElement instanceof MElementContainer<?>) {
				return getSubContext((MUIElement) selectedElement);
			}
		}
		return null;
	}
	private void internalFixContext(MPart part, MUIElement oldSelectedElement) {
		if (oldSelectedElement == null) {
			return;
		}
		MContext parentPart = getParentWithContext(oldSelectedElement);
		if (parentPart == null) {