From 2b5941cdc1435b8915ba28cbf891cb1ad32e9314 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 16 Mar 2012 11:45:11 +0200 Subject: [PATCH] Better support for adding multiple styles through addStyleName --- src/com/vaadin/ui/AbstractComponent.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index 4c49dc34d3..e2e8a9693e 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -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()); } -- 2.39.5