aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Label.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-12-13 12:12:12 +0200
committerArtur Signell <artur@vaadin.com>2014-12-14 21:24:26 +0200
commit3f7c75415bc73ab750f809bde0c5da02f5d8e7c2 (patch)
treeab81704a3c74a6ee6d4f5e431c220eaa155050a7 /server/src/com/vaadin/ui/Label.java
parent2789f701678106e9f5141b096706ace0d6880780 (diff)
downloadvaadin-framework-3f7c75415bc73ab750f809bde0c5da02f5d8e7c2.tar.gz
vaadin-framework-3f7c75415bc73ab750f809bde0c5da02f5d8e7c2.zip
Support plain-text attribute for Label (#7749)
Change-Id: I4ef210d131f1e616b501468cb94ea518945a3b30
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, "");
+ }
}
}