List of usage examples for com.vaadin.ui Component addAttachListener
public Registration addAttachListener(AttachListener listener);
From source file:info.magnolia.ui.framework.app.DefaultAppView.java
License:Open Source License
@Override public void setTheme(String themeName) { String stylename = String.format("app-%s", themeName); final String themeUrl = String.format("../%s/styles.css", themeName); final Component vaadinComponent = asVaadinComponent(); vaadinComponent.addStyleName(stylename); vaadinComponent.addAttachListener(new AttachListener() { @Override/*from w w w . j a v a2s. c o m*/ public void attach(AttachEvent event) { ThemeResource res = new ThemeResource(themeUrl); CSSInject cssInject = new CSSInject(vaadinComponent.getUI()); cssInject.addStyleSheet(res); } }); }