Package org.eclipse.draw2d
Class ToolTipHelper
java.lang.Object
org.eclipse.draw2d.PopUpHelper
org.eclipse.draw2d.ToolTipHelper
This class is used by SWTEventDispatcher as support to display Figure
 tooltips on a mouse hover event. Tooltips are drawn directly below the cursor
 unless the display does not allow, in which case the tooltip will be drawn
 directly above the cursor. Tooltips will be displayed with a LineBorder. The
 background of the tooltips will be the standard SWT tooltipBackground color
 unless the Figure's tooltip has set its own background.
- 
Field SummaryFields inherited from class org.eclipse.draw2d.PopUpHelpercontrol, shellStyle
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a ToolTipHelper to be associated with Control c.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddisplayToolTipNear(IFigure hoverSource, IFigure tip, int eventX, int eventY) Sets the LightWeightSystem's contents to the passed tooltip, and displays the tip.voiddispose()Disposes of the tooltip's shell and kills the timer.protected voidhide()Hides this PopUpHelper's Shell.protected voidDesired popup helper behavior is achieved by writing listeners that manipulate the behavior of the PopUpHelper's Shell.static voidsetDefaultHideDelay(int defaultHideDelay) Sets the default tooltip hide delay, which is the number in ms after which the tooltip will disappear again if not overwritten usingsetHideDelay(int).voidsetHideDelay(int hideDelay) Sets the tooltip hide delay, which is the amount in ms, after which the tooltip will disappear again.voidupdateToolTip(IFigure figureUnderMouse, IFigure tip, int eventX, int eventY) Displays the hover source's tooltip if a tooltip of another source is currently being displayed.Methods inherited from class org.eclipse.draw2d.PopUpHelpercreateLightweightSystem, createShell, getLightweightSystem, getShell, getShellTrimSize, isShowing, setBackgroundColor, setForegroundColor, setShellBounds, show
- 
Constructor Details- 
ToolTipHelperConstructs a ToolTipHelper to be associated with Control c.- Parameters:
- c- the control
- Since:
- 2.0
 
 
- 
- 
Method Details- 
setHideDelaypublic void setHideDelay(int hideDelay) Sets the tooltip hide delay, which is the amount in ms, after which the tooltip will disappear again.- Parameters:
- hideDelay- The delay after which the tooltip is hidden again, in ms.
- Since:
- 3.10
 
- 
setDefaultHideDelaypublic static void setDefaultHideDelay(int defaultHideDelay) Sets the default tooltip hide delay, which is the number in ms after which the tooltip will disappear again if not overwritten usingsetHideDelay(int).- Parameters:
- defaultHideDelay- the delay in ms after which the tooltip is hidden
- Since:
- 3.15
 
- 
displayToolTipNearSets the LightWeightSystem's contents to the passed tooltip, and displays the tip. The tip will be displayed only if the tip source is different than the previously viewed tip source. (i.e. The cursor has moved off of the previous tooltip source figure.)The tooltip will be painted directly below the cursor if possible, otherwise it will be painted directly above cursor. - Parameters:
- hoverSource- the figure over which the hover event was fired
- tip- the tooltip to be displayed
- eventX- the x coordinate of the hover event
- eventY- the y coordinate of the hover event
- Since:
- 2.0
 
- 
disposepublic void dispose()Disposes of the tooltip's shell and kills the timer.- Overrides:
- disposein class- PopUpHelper
- See Also:
 
- 
hideprotected void hide()Description copied from class:PopUpHelperHides this PopUpHelper's Shell.- Overrides:
- hidein class- PopUpHelper
 
- 
hookShellListenersprotected void hookShellListeners()Description copied from class:PopUpHelperDesired popup helper behavior is achieved by writing listeners that manipulate the behavior of the PopUpHelper's Shell. Override this method and add these listeners here.- Specified by:
- hookShellListenersin class- PopUpHelper
- See Also:
 
- 
updateToolTipDisplays the hover source's tooltip if a tooltip of another source is currently being displayed.- Parameters:
- figureUnderMouse- the figure over which the cursor was when called
- tip- the tooltip to be displayed
- eventX- the x coordinate of the cursor
- eventY- the y coordinate of the cursor
- Since:
- 2.0
 
 
-