diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-27 10:47:29 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-27 10:48:01 +0300 |
commit | c3e4b560f226b4c544cdab455ecabecd5c85d02c (patch) | |
tree | 4992698626695929fb158282f6a423f0de584891 /server | |
parent | b20adbbded1f0b04dcbc7074b166339eb884dcc1 (diff) | |
parent | 2f18ad6f186051f9540cf13784c0936683b11bae (diff) | |
download | vaadin-framework-c3e4b560f226b4c544cdab455ecabecd5c85d02c.tar.gz vaadin-framework-c3e4b560f226b4c544cdab455ecabecd5c85d02c.zip |
Merge branch 'master' into valo
Change-Id: Iffe877e047ee29dbd4e5b3a6098f82da3d0a47cc
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/UI.java | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index a72cbe5c30..4bde8a95b3 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -549,8 +549,6 @@ public abstract class UI extends AbstractSingleComponentContainer implements private boolean resizeLazy = false; - private String theme; - private Navigator navigator; private PushConnection pushConnection = null; @@ -633,7 +631,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements this.embedId = embedId; // Actual theme - used for finding CustomLayout templates - theme = request.getParameter("theme"); + getState(false).theme = request.getParameter("theme"); getPage().init(request); @@ -1135,12 +1133,31 @@ public abstract class UI extends AbstractSingleComponentContainer implements } /** - * Gets the theme that was used when the UI was initialized. + * Gets the theme currently in use by this UI * * @return the theme name */ public String getTheme() { - return theme; + return getState(false).theme; + } + + /** + * Sets the theme currently in use by this UI + * <p> + * Calling this method will remove the old theme (CSS file) from the + * application and add the new theme. + * <p> + * Note that this method is NOT SAFE to call in a portal environment or + * other environment where there are multiple UIs on the same page. The old + * CSS file will be removed even if there are other UIs on the page which + * are still using it. + * + * @since + * @param theme + * The new theme name + */ + public void setTheme(String theme) { + getState().theme = theme; } /** |