]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed #2853 - No tooltip for embedded content
authorArtur Signell <artur.signell@itmill.com>
Thu, 21 May 2009 18:10:46 +0000 (18:10 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 21 May 2009 18:10:46 +0000 (18:10 +0000)
Added tooltip for embedded containing an image

svn changeset:7943/svn branch:6.0

src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java
src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java

index b946896ed34a9b40ec5a34a340d53675cfcbb757..c15c738a2978df99414d5ffda944339ecbe81fa6 100644 (file)
@@ -19,6 +19,7 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
 import com.vaadin.terminal.gwt.client.Paintable;
 import com.vaadin.terminal.gwt.client.UIDL;
 import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VTooltip;
 
 public class VEmbedded extends HTML implements Paintable {
     private static String CLASSNAME = "v-embedded";
@@ -85,6 +86,12 @@ public class VEmbedded extends HTML implements Paintable {
                     getElement().appendChild(el);
                 }
 
+                /*
+                 * Sink tooltip events so tooltip is displayed when hovering the
+                 * image.
+                 */
+                sinkEvents(VTooltip.TOOLTIP_EVENTS);
+
             } else if (type.equals("browser")) {
                 if (browserElement == null) {
                     setHTML("<iframe width=\"100%\" height=\"100%\" frameborder=\"0\" src=\""
@@ -221,5 +228,7 @@ public class VEmbedded extends HTML implements Paintable {
         if (DOM.eventGetType(event) == Event.ONLOAD) {
             Util.notifyParentOfSizeChange(this, true);
         }
+
+        client.handleTooltipEvent(event, this);
     }
 }
index 6ce788f26278871cf9dff40940c3bc0473032596..37dbacb83085e5eccab20b1b0d8f931206d04e95 100644 (file)
@@ -19,7 +19,7 @@ public class EmbeddedTooltip extends TestBase {
     @Override\r
     protected void setup() {\r
         Embedded e = new Embedded("Embedded caption", new ThemeResource(\r
-                "icons/64/ok.png"));\r
+                "../runo/icons/64/ok.png"));\r
         e\r
                 .setDescription("Embedded tooltip, only shown on caption, not on the image");\r
         addComponent(e);\r