Bug 335889 E4Application#stop cannot shutdown the workbench
E4Application#stop() currently does nothing. As a result, if you trigger a shutdown of the OSGi runtime programmatically (e.g., getBundle(0).stop()), the UI workbench is not closed. Any subsequent clicking or interaction with the UI workbench triggers a cascade of errors. I think E4Application should hold onto the workbench in a field. The stop() method should call workbench.close().
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/E4Application.java
private static final String WORKSPACE_VERSION_KEY = "org.eclipse.core.runtime"; 
	private static final String WORKSPACE_VERSION_VALUE = "2"; 
	private String[] args;
	private IModelResourceHandler handler;
	private Display display = null;
	public static final String THEME_ID = "cssTheme";
	private Object lcManager;
	public Display getApplicationDisplay() {
		if (display == null) {
			display = Display.getDefault();
		}
		return display;
	}
	public Object start(IApplicationContext applicationContext)
			throws Exception {
		
		
		
		
		IProduct product = Platform.getProduct();
		if (product.getName() != null) {
			Display.setAppName(product.getName());
		}
		Display display = getApplicationDisplay();
		E4Workbench workbench = createE4Workbench(applicationContext, display);
		Location instanceLocation = (Location) workbench.getContext().get(
				E4Workbench.INSTANCE_LOCATION);
		Shell shell = display.getActiveShell();
		if (shell == null)
			shell = new Shell();