summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Label.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/Label.java')
-rw-r--r--server/src/com/vaadin/ui/Label.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java
index a4d9da752d..f882940fe6 100644
--- a/server/src/com/vaadin/ui/Label.java
+++ b/server/src/com/vaadin/ui/Label.java
@@ -590,6 +590,11 @@ public class Label extends AbstractComponent implements Property<String>,
if (innerHtml != null && !"".equals(innerHtml)) {
setValue(innerHtml);
}
+ if (design.hasAttr(DESIGN_ATTR_PLAIN_TEXT)) {
+ setContentMode(ContentMode.TEXT);
+ } else {
+ setContentMode(ContentMode.HTML);
+ }
}
/*
@@ -601,6 +606,7 @@ public class Label extends AbstractComponent implements Property<String>,
protected Collection<String> getCustomAttributes() {
Collection<String> result = super.getCustomAttributes();
result.add("value");
+ result.add("content-mode");
return result;
}
@@ -618,5 +624,9 @@ public class Label extends AbstractComponent implements Property<String>,
if (content != null) {
design.html(getValue());
}
+ // plain-text (default is html)
+ if (getContentMode() == ContentMode.TEXT) {
+ design.attr(DESIGN_ATTR_PLAIN_TEXT, "");
+ }
}
}