diff options
author | Artur Signell <artur.signell@itmill.com> | 2009-05-21 18:10:46 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2009-05-21 18:10:46 +0000 |
commit | 90a3c7654a4bd48d2d1db3fab43b5181c8723248 (patch) | |
tree | 648c5a02c84de9b9c5d746d6bf92ccec1d4ee77b | |
parent | 69817588b8399ab21c917d5fb15f1581b9111ef5 (diff) | |
download | vaadin-framework-90a3c7654a4bd48d2d1db3fab43b5181c8723248.tar.gz vaadin-framework-90a3c7654a4bd48d2d1db3fab43b5181c8723248.zip |
Fixed #2853 - No tooltip for embedded content
Added tooltip for embedded containing an image
svn changeset:7943/svn branch:6.0
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java | 9 | ||||
-rw-r--r-- | src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java index b946896ed3..c15c738a29 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VEmbedded.java @@ -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); } } diff --git a/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java b/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java index 6ce788f262..37dbacb830 100644 --- a/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java +++ b/src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java @@ -19,7 +19,7 @@ public class EmbeddedTooltip extends TestBase { @Override
protected void setup() {
Embedded e = new Embedded("Embedded caption", new ThemeResource(
- "icons/64/ok.png"));
+ "../runo/icons/64/ok.png"));
e
.setDescription("Embedded tooltip, only shown on caption, not on the image");
addComponent(e);
|