Bug 281236 Cannot switch themes in contacts demo
When I try to switch to the dark or light theme in contacts, I get exception traces that end with: Caused by: java.lang.NullPointerException at org.eclipse.e4.demo.contacts.handlers.ThemeUtil$1.run(ThemeUtil.java:46) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4113) at org.eclipse.e4.demo.contacts.handlers.ThemeUtil.switchTheme(ThemeUtil.java:37) at org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler.execute(BrightThemeHandler.java:20) ... 30 more PW
bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/workbench/swt/internal/CSSStylingSupport.java
try {
			URL url = FileLocator.resolve(new URL(cssURI.toString()));
			display.setData("org.eclipse.e4.ui.css.core.cssURL", url); 		
			InputStream stream = url.openStream();
			engine.parseStyleSheet(stream);
			stream.close();
		} catch (MalformedURLException e1) {
			
			e1.printStackTrace();
		} catch (IOException e1) {
			
			e1.printStackTrace();
		}
		appContext.set(IStylingEngine.class.getName(), new IStylingEngine() {
			public void setClassname(Object widget, String classname) {
				((Widget) widget).setData(
						"org.eclipse.e4.ui.css.CssClassName", classname); 
				engine.applyStyles(widget, true);
			}
			public void setId(Object widget, String id) {
				((Widget) widget).setData("org.eclipse.e4.ui.css.id", id); 
				engine.applyStyles(widget, true);
			}
			public void style(Object widget) {
				engine.applyStyles(widget, true);
			}
		});
	}
}