A Rich UI tooltip widget defines hover help: a rectangle that includes text and widgets and is displayed only when the user hovers over a widget.
A tooltip is displayed only if you enable the tooltip widget, as described in this section. You can use the same tooltip for several widgets, and you can enable the tooltip for a given widget in response to a runtime event.
package client; import org.eclipse.edt.rui.widgets.Box; import org.eclipse.edt.rui.widgets.Button; import org.eclipse.edt.rui.widgets.Tooltip; import eglx.ui.rui.Event; import eglx.ui.rui.RUIHandler; Handler MyHandler Type RUIHandler { initialUI = [theButton], onConstructionFunction= begin } theButton Button { text = "Start", onClick ::= click }; theToolTip Tooltip { text = "To toggle the text, click the button!", delay = 1000 }; myBox Box{}; function begin() theToolTip.enable(theButton); end Function click(e Event in) if (theButton.text == "Start") theButton.text = "Stop"; else theButton.text = "Start"; end end end
package client; import org.eclipse.edt.rui.widgets.Box; import org.eclipse.edt.rui.widgets.Button; import org.eclipse.edt.rui.widgets.Tooltip; import org.eclipse.edt.rui.widgets.HTML; import eglx.ui.rui.Event; import eglx.ui.rui.RUIHandler; Handler MyHandler Type RUIHandler { initialUI = [theButton], onConstructionFunction= begin } theButton Button { text = "Start", onClick ::= click }; theToolTip Tooltip { text = "To toggle the text, click the button!", delay = 800, provider = GoToWebsite }; myBox Box{}; function begin() theToolTip.enable(theButton); end Function click(e Event in) if (theButton.text == "Start") theButton.text = "Stop"; else theButton.text = "Start"; end end Function GoToWebsite(myWidget any in) returns(Box) myLink html {text = "Do more with " + "target = \"_blank\", href=\"http://www.org.eclipse/edt\">EGL</a>"}; myBox.children = [mylink]; return (myBox); end end
Delegate TooltipTextProvider(widget any in) returns(Box) end
If your users are accessing a Rich UI application by way of Microsoft™ Internet Explorer 8 or less, be aware of the issue described in “Rich UI memory management for Microsoft Internet Explorer.”
Other supported fields and functions are described in the following topics in the EGL Programmer’s Guide: “Rich UI widget fields” and ”Rich UI widget functions.”
import org.eclipse.edt.rui.widgets.Tooltip;