]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2426 Re-added CONTENT_UIDL as deprecated
authorArtur Signell <artur.signell@itmill.com>
Tue, 13 Jan 2009 06:26:00 +0000 (06:26 +0000)
committerArtur Signell <artur.signell@itmill.com>
Tue, 13 Jan 2009 06:26:00 +0000 (06:26 +0000)
svn changeset:6507/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/ILabel.java
src/com/itmill/toolkit/ui/Label.java

index a77ed18d816f681feb3cc01197169ad316c74069..f3bec455f08a998983debcffe1cfdce22faf297d 100644 (file)
@@ -69,6 +69,8 @@ public class ILabel extends HTML implements Paintable {
             setHTML("");
             // add preformatted text to dom
             getElement().appendChild(preElement);
+        } else if ("uidl".equals(mode)) {
+            setHTML(uidl.getChildrenAsXML());
         } else if ("xhtml".equals(mode)) {
             setHTML(uidl.getChildUIDL(0).getChildUIDL(0).getChildString(0));
             sinkOnloads = true;
index b037c5e82234224d91ede02068fa9bab7b5b2e3a..b11f9f5a2ebde621ee3f10e5457aaf96ba5e4c0c 100644 (file)
@@ -51,6 +51,15 @@ public class Label extends AbstractComponent implements Property,
      */
     public static final int CONTENT_PREFORMATTED = 1;
 
+    /**
+     * Formatted content mode, where the contents is XML restricted to the UIDL
+     * 1.0 formatting markups.
+     * 
+     * @deprecated Use CONTENT_XML instead.
+     */
+    @Deprecated
+    public static final int CONTENT_UIDL = 2;
+
     /**
      * Content mode, where the label contains XHTML. Contents is then enclosed
      * in DIV elements having namespace of
@@ -190,6 +199,8 @@ public class Label extends AbstractComponent implements Property,
         }
         if (contentMode == CONTENT_TEXT) {
             target.addText(toString());
+        } else if (contentMode == CONTENT_UIDL) {
+            target.addUIDL(toString());
         } else if (contentMode == CONTENT_XHTML) {
             target.startTag("data");
             target.addXMLSection("div", toString(),
@@ -482,14 +493,16 @@ public class Label extends AbstractComponent implements Property,
         String thisValue;
         String otherValue;
 
-        if (contentMode == CONTENT_XML || contentMode == CONTENT_XHTML) {
+        if (contentMode == CONTENT_XML || contentMode == CONTENT_UIDL
+                || contentMode == CONTENT_XHTML) {
             thisValue = stripTags(toString());
         } else {
             thisValue = toString();
         }
 
         if (other instanceof Label
-                && (((Label) other).getContentMode() == CONTENT_XML || ((Label) other)
+                && (((Label) other).getContentMode() == CONTENT_XML
+                        || ((Label) other).getContentMode() == CONTENT_UIDL || ((Label) other)
                         .getContentMode() == CONTENT_XHTML)) {
             otherValue = stripTags(other.toString());
         } else {