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.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java
if (!children.isEmpty()) {
					((MElementContainer) element)
							.setSelectedElement((MUIElement) children.get(0));
				}
			}
		} else if (element instanceof MElementContainer<?>) {
			for (Object child : ((MElementContainer<?>) element).getChildren()) {
				if (child instanceof MUIElement) {
					createGui((MUIElement) child, element,
							getParentContext((MUIElement) child));
					if (child instanceof MContext) {
						IEclipseContext childContext = ((MContext) child)
								.getContext();
						IEclipseContext pContext = getParentContext((MUIElement) child);
						if (childContext != null
								&& pContext.getActiveChild() == null) {
							childContext.activate();
						}
					}
				}
			}
			if (element instanceof MWindow) {
				MWindow window = (MWindow) element;
				for (MWindow childWindow : window.getWindows()) {
					createGui(childWindow, element, window.getContext());
				}
			}
			if (element instanceof MPerspective) {
				MPerspective perspective = (MPerspective) element;
				for (MWindow childWindow : perspective.getWindows()) {