aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-06-14 13:53:43 +0000
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>2007-06-14 13:53:43 +0000
commit25efcbae5b40424e7c60a4438faf6ba522b0f1ce (patch)
treeb71d159cf4a3927a0da24c210809171adff38b3b
parent6c1b9856173a329c870070af7cc61e302f839251 (diff)
downloadvaadin-framework-25efcbae5b40424e7c60a4438faf6ba522b0f1ce.tar.gz
vaadin-framework-25efcbae5b40424e7c60a4438faf6ba522b0f1ce.zip
Added mode in Label UIDL when not wrapping text
svn changeset:1724/svn branch:trunk
-rw-r--r--src/com/itmill/toolkit/ui/Label.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/ui/Label.java b/src/com/itmill/toolkit/ui/Label.java
index d360e208e3..2f2e2ef6be 100644
--- a/src/com/itmill/toolkit/ui/Label.java
+++ b/src/com/itmill/toolkit/ui/Label.java
@@ -108,6 +108,9 @@ public class Label extends AbstractComponent implements Property,
*/
public static final int CONTENT_DEFAULT = CONTENT_TEXT;
+ /** Array of content mode names that are rendered in UIDL as mode attribute. */
+ private static final String[] CONTENT_MODE_NAME = {"text","pre","uidl","xhtml","xml","raw"};
+
private Property dataSource;
private int contentMode = CONTENT_DEFAULT;
@@ -203,6 +206,8 @@ public class Label extends AbstractComponent implements Property,
* if the Paint Operation fails.
*/
public void paintContent(PaintTarget target) throws PaintException {
+ if (contentMode != CONTENT_TEXT)
+ target.addAttribute("mode", CONTENT_MODE_NAME[contentMode]);
if (contentMode == CONTENT_TEXT)
target.addText(toString());
else if (contentMode == CONTENT_UIDL)