From 222876bc4057366c63060984c577bbbfb1cc3145 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Sat, 20 Sep 2014 14:22:21 +0300 Subject: [PATCH] Add autogenerated style name for UI based on its class name (#14670) Change-Id: Ic2ff4c29f997c33ea952a94c17aa9e70a0339337 --- .../com/vaadin/server/BootstrapHandler.java | 8 +- .../ui/UIAutoGeneratedStyleName.java | 43 +++++++++ .../ui/UIAutoGeneratedStyleNameTest.java | 87 +++++++++++++++++++ 3 files changed, 135 insertions(+), 3 deletions(-) create mode 100644 uitest/src/com/vaadin/tests/components/ui/UIAutoGeneratedStyleName.java create mode 100644 uitest/src/com/vaadin/tests/components/ui/UIAutoGeneratedStyleNameTest.java diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index 0605d6a2b8..f0666f63fc 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -350,7 +350,6 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { /*- Add classnames; * .v-app * .v-app-loading - * .v-app- *- Additionally added from javascript: * */ @@ -362,6 +361,8 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { mainDiv.attr("id", context.getAppId()); mainDiv.addClass("v-app"); mainDiv.addClass(context.getThemeName()); + mainDiv.addClass(context.getUIClass().getSimpleName() + .toLowerCase(Locale.ENGLISH)); if (style != null && style.length() != 0) { mainDiv.attr("style", style); } @@ -401,7 +402,7 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { builder.append("// getBrowsersToTest() { + return Collections.singletonList(Browser.FIREFOX + .getDesiredCapabilities()); + } + +} -- 2.39.5