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
createGui(childWindow, element, perspective.getContext());
				}
			}
		} else if (element instanceof MPlaceholder) {
			MPlaceholder placeholder = (MPlaceholder) element;
			MUIElement ref = placeholder.getRef();
			if (ref != null) {
				ref.setToBeRendered(true);
				createGui(ref);
				ref.setCurSharedRef(placeholder);
			}
		}
		return null;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.e4.ui.workbench.IPresentationEngine#createGui(org.eclipse
	 * .e4.ui.model.application.MUIElement)
	 */
	public Object createGui(MUIElement element) {
		return createGui(element, null, getParentContext(element));
	}
	public void removeGui(MUIElement element) {
		if (element instanceof MElementContainer<?>) {
			for (Object child : ((MElementContainer<?>) element).getChildren()) {
				if (child instanceof MUIElement) {
					removeGui((MUIElement) child);
				}