]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added mode in Label UIDL when not wrapping text
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 14 Jun 2007 13:53:43 +0000 (13:53 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Thu, 14 Jun 2007 13:53:43 +0000 (13:53 +0000)
svn changeset:1724/svn branch:trunk

src/com/itmill/toolkit/ui/Label.java

index d360e208e34b52c6265658b847297929a12ce550..2f2e2ef6be0cf2642d7d9e08e38e29e025f4eac0 100644 (file)
@@ -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)