diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-09-17 11:28:26 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-09-17 11:28:26 +0000 |
commit | 32fbbaaaa6907f2aee1657ed5bcd509abeb4ee11 (patch) | |
tree | 39973ffec7596c9d29dadbb85641d12f7ca9a0e8 | |
parent | 5644347aa2bd387ec8e54a98d5ffb8b40d39f218 (diff) | |
download | vaadin-framework-32fbbaaaa6907f2aee1657ed5bcd509abeb4ee11.tar.gz vaadin-framework-32fbbaaaa6907f2aee1657ed5bcd509abeb4ee11.zip |
Fixed #3351 - Sampler uses the same theme for all users
svn changeset:8826/svn branch:6.1
-rw-r--r-- | src/com/vaadin/demo/sampler/SamplerApplication.java | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/vaadin/demo/sampler/SamplerApplication.java b/src/com/vaadin/demo/sampler/SamplerApplication.java index 7122acf506..91ae0b4c84 100644 --- a/src/com/vaadin/demo/sampler/SamplerApplication.java +++ b/src/com/vaadin/demo/sampler/SamplerApplication.java @@ -59,6 +59,9 @@ public class SamplerApplication extends Application { // used when trying to guess theme location private static String APP_URL = null; + private String currentApplicationTheme = SAMPLER_THEME_NAME + "-" + + THEMES[0]; + @Override public void init() { setMainWindow(new SamplerWindow()); @@ -152,8 +155,6 @@ public class SamplerApplication extends Application { private final ThemeResource SELECTED_THEME_ICON = new ThemeResource( "../sampler/sampler/select-bullet.png"); - private String currentTheme = SAMPLER_THEME_NAME + "-" + THEMES[0]; - private FeatureList currentList = new FeatureGrid(); private final FeatureView featureView = new FeatureView(); private final ObjectProperty currentFeature = new ObjectProperty(null, @@ -192,7 +193,7 @@ public class SamplerApplication extends Application { setSizeFull(); mainExpand.setSizeFull(); setCaption("Vaadin Sampler"); - setTheme(currentTheme); + setTheme(currentApplicationTheme); // topbar (navigation) HorizontalLayout nav = new HorizontalLayout(); @@ -390,8 +391,10 @@ public class SamplerApplication extends Application { + themeName.substring(1) + " theme"); theme.setItemIcon(id, EMPTY_THEME_ICON); } - theme.setValue(currentTheme); - theme.setItemIcon(currentTheme, SELECTED_THEME_ICON); + + final String currentWindowTheme = getTheme(); + theme.setValue(currentWindowTheme); + theme.setItemIcon(currentWindowTheme, SELECTED_THEME_ICON); theme.addListener(new ComboBox.ValueChangeListener() { public void valueChange(ValueChangeEvent event) { @@ -399,9 +402,14 @@ public class SamplerApplication extends Application { final String newTheme = event.getProperty().getValue() .toString(); setTheme(newTheme); - theme.setItemIcon(currentTheme, EMPTY_THEME_ICON); + + for (String themeName : THEMES) { + String id = SAMPLER_THEME_NAME + "-" + themeName; + theme.setItemIcon(id, EMPTY_THEME_ICON); + } + theme.setItemIcon(newTheme, SELECTED_THEME_ICON); - currentTheme = newTheme; + currentApplicationTheme = newTheme; } }); |