]> source.dussan.org Git - vaadin-framework.git/commitdiff
simple flash support for embedded component
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 17 Aug 2007 06:40:01 +0000 (06:40 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 17 Aug 2007 06:40:01 +0000 (06:40 +0000)
svn changeset:2038/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IEmbedded.java

index 5e3679391083d55fc0594cff8c3505ee3549d8c3..ce9a261a5d2fc4aed8fc5503ecf8fea65a51b276 100644 (file)
@@ -8,8 +8,20 @@ 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;
+               
                if(uidl.hasAttribute("type") && uidl.getStringAttribute("type").equals("image")) {
                        setHTML("<img src=\""+ uidl.getStringAttribute("src") +"\"/>");
+               } else if(uidl.hasAttribute("mimetype") && 
+                               uidl.getStringAttribute("mimetype").equals("application/x-shockwave-flash")) {
+                       String w = uidl.hasAttribute("width") ? uidl.getStringAttribute("width") : "100";
+                       String h = uidl.hasAttribute("height") ? uidl.getStringAttribute("height") : "100";
+                       
+                       setHTML("<object width=\""+w+"\" height=\""+h+"\"><param name=\"movie\" value=\""+
+                                       uidl.getStringAttribute("src") + "\"><embed src=\""+
+                                       uidl.getStringAttribute("src") + "\" width=\""+ w +
+                                       "\" height=\""+h+"\"></embed></object>");
                } else {
                        setText("Terminal don't know how ty handle this type of embed");
                }