From d517ebf66d111e6537d40a97e2982086b44c0143 Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Fri, 16 Nov 2007 13:42:51 +0000 Subject: [PATCH] ThemeResource now works in Embedded svn changeset:2853/svn branch:trunk --- .../terminal/gwt/client/ui/IEmbedded.java | 87 +++++++++++-------- 1 file changed, 49 insertions(+), 38 deletions(-) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java index fe3715d08a..3b4134ba20 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java @@ -8,44 +8,55 @@ import com.itmill.toolkit.terminal.gwt.client.UIDL; public class IEmbedded extends HTML implements Paintable { - public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - if (client.updateComponent(this, uidl, true)) { - return; - } - String w = uidl.hasAttribute("width") ? uidl - .getStringAttribute("width") : "100%"; - String h = uidl.hasAttribute("height") ? uidl - .getStringAttribute("height") : "100%"; - DOM.setStyleAttribute(getElement(), "width", w); - DOM.setStyleAttribute(getElement(), "height", h); + public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { + if (client.updateComponent(this, uidl, true)) { + return; + } + String w = uidl.hasAttribute("width") ? uidl + .getStringAttribute("width") : "100%"; + String h = uidl.hasAttribute("height") ? uidl + .getStringAttribute("height") : "100%"; + DOM.setStyleAttribute(getElement(), "width", w); + DOM.setStyleAttribute(getElement(), "height", h); - if (uidl.hasAttribute("type")) { - String type = uidl.getStringAttribute("type"); - if (type.equals("image")) { - setHTML(""); - } else if (type.equals("browser")) { - setHTML(""); - } else { - ApplicationConnection.getConsole().log( - "Unknown Embedded type '" + type + "'"); - } - } else if (uidl.hasAttribute("mimetype")) { - String mime = uidl.getStringAttribute("mimetype"); - if (mime.equals("application/x-shockwave-flash")) { - setHTML(""); - } else { - ApplicationConnection.getConsole().log( - "Unknown Embedded mimetype '" + mime + "'"); - } - } else { - ApplicationConnection.getConsole().log( - "Unknown Embedded; no type or mimetype attribute"); - } + if (uidl.hasAttribute("type")) { + String type = uidl.getStringAttribute("type"); + if (type.equals("image")) { + setHTML(""); + } else if (type.equals("browser")) { + setHTML(""); + } else { + ApplicationConnection.getConsole().log( + "Unknown Embedded type '" + type + "'"); + } + } else if (uidl.hasAttribute("mimetype")) { + String mime = uidl.getStringAttribute("mimetype"); + if (mime.equals("application/x-shockwave-flash")) { + setHTML(""); + } else { + ApplicationConnection.getConsole().log( + "Unknown Embedded mimetype '" + mime + "'"); + } + } else { + ApplicationConnection.getConsole().log( + "Unknown Embedded; no type or mimetype attribute"); + } - } + } + + /** + * Helper to return translated src attribute from embeddeds uidl + * + * @param uidl + * @param client + * @return + */ + private String getSrc(UIDL uidl, ApplicationConnection client) { + return client.translateToolkitUri(uidl.getStringAttribute("src")); + } } -- 2.39.5