]> source.dussan.org Git - vaadin-framework.git/commitdiff
Refactoring ajax theme to include real inheritance and conform to OpenAjax Alliance...
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 11 Jan 2007 20:07:50 +0000 (20:07 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 11 Jan 2007 20:07:50 +0000 (20:07 +0000)
svn changeset:236/svn branch:toolkit

src/com/itmill/toolkit/terminal/web/ApplicationServlet.java

index 4de1b052bc501dfd672ce863cbbab81be58aa1b6..2482a4b13f205112d6c67c9bf6d9f3a77644fe8f 100644 (file)
@@ -635,12 +635,17 @@ public class ApplicationServlet extends HttpServlet implements
                                        }
 
                                        // Find theme
+                                       String themeName = window.getTheme() != null ? window
+                                                       .getTheme() : DEFAULT_THEME;
+                                       if (unhandledParameters.get("theme") != null) {
+                                               themeName = (String) ((Object[]) unhandledParameters
+                                                               .get("theme"))[0];
+                                       }
                                        Theme theme = themeSource
-                                                       .getThemeByName(window.getTheme() != null ? window
-                                                                       .getTheme() : DEFAULT_THEME);
+                                                       .getThemeByName(themeName);
                                        if (theme == null)
-                                               throw new ServletException("Default theme (named '"
-                                                               + DEFAULT_THEME + "') can not be found");
+                                               throw new ServletException("Theme (named '"
+                                                               + themeName + "') can not be found");
 
                                        // If UIDL rendering mode is preferred, a page for it is
                                        // rendered
@@ -706,7 +711,7 @@ public class ApplicationServlet extends HttpServlet implements
                                                page.write("<script language=\"JavaScript\">\n");
                                                String appUrl = getApplicationUrl(request).toString();
                                                page
-                                                               .write("var client = new ITMillToolkitClient("
+                                                               .write("var client = new itmill.toolkit.Client("
                                                                                + "document.getElementById('ajax-window'),"
                                                                                + "\""
                                                                                + appUrl
@@ -723,10 +728,10 @@ public class ApplicationServlet extends HttpServlet implements
 
                                                for (int k = themes.size() - 1; k >= 0; k--) {
                                                        t = (Theme) themes.get(k);
-                                                       String themeObjName = t.getName() + "Theme";
-                                                       themeObjName = themeObjName.substring(0, 1)
+                                                       String themeObjName = "itmill.toolkit.themes." + 
+                                                               t.getName().substring(0, 1)
                                                                        .toUpperCase()
-                                                                       + themeObjName.substring(1);
+                                                                       + t.getName().substring(1);
                                                        page.write(" (new " + themeObjName + "(\""
                                                                        + resourcePath
                                                                        + ((Theme) themes.get(k)).getName()