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
removeGui(element);
				}
			}
		};
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC,
				UIEvents.UIElement.TOBERENDERED), toBeRenderedHandler);
	}
	public void setCreateContributions(boolean createContributions) {
		this.createContributions = createContributions;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.e4.ui.workbench.IPresentationEngine#createGui(org.eclipse
	 * .e4.ui.model.application.MUIElement, java.lang.Object)
	 */
	public Object createGui(MUIElement element, Object parentWidget,
			IEclipseContext parentContext) {
		if (!element.isToBeRendered()) {
			return null;
		}
		if (element instanceof MContext) {
			MContext mcontext = (MContext) element;
			IEclipseContext createdContext = mcontext.getContext();
			if (createdContext == null) {
				String contextName = element.getClass().getInterfaces()[0]
						.getName() + " eclipse context"; 
				createdContext = (parentContext != null) ? parentContext
						.createChild(contextName) : EclipseContextFactory