aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2008-11-27 14:25:58 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2008-11-27 14:25:58 +0000
commitddcd1d0716699a1e29834f93fc1d0f14c28e6473 (patch)
treece961efba339668b14475daa825dc4fc3fa8eb58
parent647b471bed01c0280f5729c4cd143c02fdd13b7f (diff)
downloadvaadin-framework-ddcd1d0716699a1e29834f93fc1d0f14c28e6473.tar.gz
vaadin-framework-ddcd1d0716699a1e29834f93fc1d0f14c28e6473.zip
fixes #2236, ICaption elements now add server side added class names to caption with i-caption- prefix
svn changeset:6018/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/terminal/gwt/client/ICaption.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
index 7871aed7d9..229be453d9 100644
--- a/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
+++ b/src/com/itmill/toolkit/terminal/gwt/client/ICaption.java
@@ -72,12 +72,19 @@ public class ICaption extends HTML {
setStyleName(getElement(), "i-disabled", uidl.hasAttribute("disabled"));
- boolean isEmpty = true;
-
boolean wasPlacedAfterComponent = placedAfterComponent;
placedAfterComponent = true;
+ String style = CLASSNAME;
+ if (uidl.hasAttribute("style")) {
+ final String[] styles = uidl.getStringAttribute("style").split(" ");
+ for (int i = 0; i < styles.length; i++) {
+ style += " " + CLASSNAME + "-" + styles[i];
+ }
+ }
+ setStyleName(style);
+
if (uidl.hasAttribute(ATTRIBUTE_ICON)) {
if (icon == null) {
icon = new Icon(client);
@@ -93,7 +100,6 @@ public class ICaption extends HTML {
icon.setUri(uidl.getStringAttribute(ATTRIBUTE_ICON));
iconOnloadHandled = false;
- isEmpty = false;
} else if (icon != null) {
// Remove existing
DOM.removeChild(getElement(), icon.getElement());
@@ -114,7 +120,6 @@ public class ICaption extends HTML {
if (c == null) {
c = "";
} else {
- isEmpty = false;
placedAfterComponent = false;
}
DOM.setInnerText(captionText, c);
@@ -133,7 +138,6 @@ public class ICaption extends HTML {
}
if (uidl.getBooleanAttribute(ATTRIBUTE_REQUIRED)) {
- isEmpty = false;
if (requiredFieldIndicator == null) {
requiredFieldIndicator = DOM.createDiv();
requiredFieldIndicator
@@ -151,7 +155,6 @@ public class ICaption extends HTML {
if (uidl.hasAttribute(ATTRIBUTE_ERROR)
&& !uidl.getBooleanAttribute(ATTRIBUTE_HIDEERRORS)) {
- isEmpty = false;
if (errorIndicatorElement == null) {
errorIndicatorElement = DOM.createDiv();
DOM.setInnerHTML(errorIndicatorElement, "&nbsp;");