aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/client/VCaption.java
diff options
context:
space:
mode:
authorSami Viitanen <sami.viitanen@vaadin.com>2012-06-28 15:43:11 +0300
committerArtur Signell <artur@vaadin.com>2012-06-28 16:49:54 +0300
commit18ac8b25501e28cfcfc3271d2c6722a00fa01b98 (patch)
tree3e2b4d90e98c3531e9bd4ac4847cf48a70a6b70d /src/com/vaadin/terminal/gwt/client/VCaption.java
parent92784107eddb53bd1a5f651775937a3caf2eeae0 (diff)
downloadvaadin-framework-18ac8b25501e28cfcfc3271d2c6722a00fa01b98.tar.gz
vaadin-framework-18ac8b25501e28cfcfc3271d2c6722a00fa01b98.zip
Tooltips are now handled by the connector and not the widget (#8425)
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/VCaption.java')
-rw-r--r--src/com/vaadin/terminal/gwt/client/VCaption.java27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/VCaption.java b/src/com/vaadin/terminal/gwt/client/VCaption.java
index 6f3fcf2c3a..2f7ba87870 100644
--- a/src/com/vaadin/terminal/gwt/client/VCaption.java
+++ b/src/com/vaadin/terminal/gwt/client/VCaption.java
@@ -35,6 +35,8 @@ public class VCaption extends HTML {
ICON, CAPTION, REQUIRED, ERROR
}
+ private TooltipInfo tooltipInfo = null;
+
/**
* Creates a caption that is not linked to a {@link ComponentConnector}.
*
@@ -74,8 +76,6 @@ public class VCaption extends HTML {
}
setStyleName(CLASSNAME);
- sinkEvents(VTooltip.TOOLTIP_EVENTS);
-
}
/**
@@ -345,9 +345,6 @@ public class VCaption extends HTML {
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
final Element target = DOM.eventGetTarget(event);
- if (client != null && owner != null && target != getElement()) {
- client.handleTooltipEvent(event, owner);
- }
if (DOM.eventGetType(event) == Event.ONLOAD
&& icon.getElement() == target) {
@@ -555,6 +552,26 @@ public class VCaption extends HTML {
}
}
+ /**
+ * Sets the tooltip that should be shown for the caption
+ *
+ * @param tooltipInfo
+ * The tooltip that should be shown or null if no tooltip should
+ * be shown
+ */
+ public void setTooltipInfo(TooltipInfo tooltipInfo) {
+ this.tooltipInfo = tooltipInfo;
+ }
+
+ /**
+ * Returns the tooltip that should be shown for the caption
+ *
+ * @return The tooltip to show or null if no tooltip should be shown
+ */
+ public TooltipInfo getTooltipInfo() {
+ return tooltipInfo;
+ }
+
protected Element getTextElement() {
return captionText;
}