]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix for #3185 - Add possibility to specify application CSS class name
authorArtur Signell <artur.signell@itmill.com>
Thu, 19 Nov 2009 14:12:20 +0000 (14:12 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 19 Nov 2009 14:12:20 +0000 (14:12 +0000)
svn changeset:9924/svn branch:6.2

src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java

index 692f30dc92b1282565933207d7186ae7cf40b216..b2ef6f466f0d1a95fbe75042a419f9abfbb2f0c3 100644 (file)
@@ -1385,13 +1385,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet {
          *      .v-theme-<themeName, remove non-alphanum>
          */
 
-        String appClass = "v-app-";
-        try {
-            appClass += getApplicationClass().getSimpleName();
-        } catch (ClassNotFoundException e) {
-            appClass += "unknown";
-            e.printStackTrace();
-        }
+        String appClass = "v-app-" + getApplicationCSSClassName();
+
         String themeClass = "";
         if (themeName != null) {
             themeClass = "v-theme-" + themeName.replaceAll("[^a-zA-Z0-9]", "");
@@ -1419,6 +1414,24 @@ public abstract class AbstractApplicationServlet extends HttpServlet {
 
     }
 
+    /**
+     * Returns the application class identifier for use in the application CSS
+     * class name in the root DIV. The application CSS class name is of form
+     * "v-app-"+getApplicationCSSClassName().
+     * 
+     * This method should normally not be overridden.
+     * 
+     * @return The CSS class name to use in combination with "v-app-".
+     */
+    protected String getApplicationCSSClassName() {
+        try {
+            return getApplicationClass().getSimpleName();
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+            return "unknown";
+        }
+    }
+
     /**
      * Get the URI for the application theme.
      *