summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2011-08-16 12:03:58 +0000
committerLeif Åstrand <leif@vaadin.com>2011-08-16 12:03:58 +0000
commit39bf8185b95149ab535699966ca4f3e38a0d37ea (patch)
tree2d81f3dcd2fef878558c66d5198b6a0fc0821d62 /src
parent2d518450045c8df937cf1f5d2557c1a4673667b1 (diff)
downloadvaadin-framework-39bf8185b95149ab535699966ca4f3e38a0d37ea.tar.gz
vaadin-framework-39bf8185b95149ab535699966ca4f3e38a0d37ea.zip
#7422 Updated fix for coping with additional spaces in the input
svn changeset:20416/svn branch:6.7
Diffstat (limited to 'src')
-rw-r--r--src/com/vaadin/ui/AbstractComponent.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java
index ad95b6ed58..836ea498fd 100644
--- a/src/com/vaadin/ui/AbstractComponent.java
+++ b/src/com/vaadin/ui/AbstractComponent.java
@@ -7,7 +7,6 @@ package com.vaadin.ui;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -225,8 +224,12 @@ public abstract class AbstractComponent implements Component, MethodEventSource
styles = new ArrayList<String>();
}
styles.clear();
- String[] styleParts = style.split(" ");
- styles.addAll(Arrays.asList(styleParts));
+ String[] styleParts = style.split(" +");
+ for (String part : styleParts) {
+ if (part.length() > 0) {
+ styles.add(part);
+ }
+ }
requestRepaint();
}
@@ -245,8 +248,12 @@ public abstract class AbstractComponent implements Component, MethodEventSource
public void removeStyleName(String style) {
if (styles != null) {
- String[] styleParts = style.split(" ");
- styles.removeAll(Arrays.asList(styleParts));
+ String[] styleParts = style.split(" +");
+ for (String part : styleParts) {
+ if (part.length() > 0) {
+ styles.remove(part);
+ }
+ }
requestRepaint();
}
}