]> source.dussan.org Git - vaadin-framework.git/commitdiff
Better support for adding multiple styles through addStyleName
authorArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 09:45:11 +0000 (11:45 +0200)
committerArtur Signell <artur@vaadin.com>
Fri, 16 Mar 2012 09:45:11 +0000 (11:45 +0200)
src/com/vaadin/ui/AbstractComponent.java

index 4c49dc34d3e08af7496dd33c3da22dba928ba4fc..e2e8a9693e6fc9a53e407c33861dd569fef54200 100644 (file)
@@ -241,6 +241,14 @@ public abstract class AbstractComponent implements Component, MethodEventSource
         if (style == null || "".equals(style)) {
             return;
         }
+        if (style.contains(" ")) {
+            // Split space separated style names and add them one by one.
+            for (String realStyle : style.split(" ")) {
+                addStyleName(realStyle);
+            }
+            return;
+        }
+
         if (getState().getStyles() == null) {
             getState().setStyles(new ArrayList<String>());
         }