From: Artur Signell Date: Fri, 16 Mar 2012 09:45:11 +0000 (+0200) Subject: Better support for adding multiple styles through addStyleName X-Git-Tag: 7.0.0.alpha2~305 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b5941cdc1435b8915ba28cbf891cb1ad32e9314;p=vaadin-framework.git Better support for adding multiple styles through addStyleName --- 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()); }