Package org.eclipse.jface.window
Class DefaultToolTip
java.lang.Object
org.eclipse.jface.window.ToolTip
org.eclipse.jface.window.DefaultToolTip
- Direct Known Subclasses:
ColumnViewerToolTipSupport
Default implementation of ToolTip that provides an iconofied label with font
and color controls by subclass.
- Since:
- 3.3
-
Field Summary
Fields inherited from class org.eclipse.jface.window.ToolTip
NO_RECREATE, RECREATE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultToolTip(Control control) Create new instance which add TooltipSupport to the widgetDefaultToolTip(Control control, int style, boolean manualActivation) Create new instance which add TooltipSupport to the widget -
Method Summary
Modifier and TypeMethodDescriptionprotected CompositecreateToolTipContentArea(Event event, Composite parent) Creates the content are of the the tooltip.protected ColorgetBackgroundColor(Event event) protected ImagegetBackgroundImage(Event event) protected Fontprotected ColorgetForegroundColor(Event event) protected Imageprotected intThe style used to create theCLabelin the default implementationprotected StringThe text displayed in theCLabelin the default implementationvoidsetBackgroundColor(Color backgroundColor) voidsetBackgroundImage(Image backgroundImage) voidvoidsetForegroundColor(Color foregroundColor) voidvoidsetStyle(int style) The style used to create theCLabelin the default implementationvoidThe text displayed in theCLabelin the default implementationMethods inherited from class org.eclipse.jface.window.ToolTip
activate, afterHideToolTip, deactivate, getData, getLocation, getToolTipArea, hide, isHideOnMouseDown, isRespectDisplayBounds, isRespectMonitorBounds, setData, setHideDelay, setHideOnMouseDown, setPopupDelay, setRespectDisplayBounds, setRespectMonitorBounds, setShift, shouldCreateToolTip, show
-
Constructor Details
-
DefaultToolTip
Create new instance which add TooltipSupport to the widget- Parameters:
control- the control on whose action the tooltip is shown
-
DefaultToolTip
Create new instance which add TooltipSupport to the widget- Parameters:
control- the control to which the tooltip is boundstyle- style passed to control tooltip behaviourmanualActivation-trueif the activation is done manually usingToolTip.show(Point)- See Also:
-
-
Method Details
-
createToolTipContentArea
Creates the content are of the the tooltip. By default this creates a CLabel to display text. To customize the text Subclasses may override the following methods- Specified by:
createToolTipContentAreain classToolTip- Parameters:
event- the event that triggered the activation of the tooltipparent- the parent of the content area- Returns:
- the content area created
-
getStyle
The style used to create theCLabelin the default implementation- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the style
-
getImage
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Imageornullif no image should be displayed
-
getForegroundColor
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Colorornullif default foreground color should be used
-
getBackgroundColor
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Colorornullif default background color should be used
-
getBackgroundImage
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Imageornullif no image should be displayed in the background
-
getFont
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Fontornullif the default font should be used
-
getText
The text displayed in theCLabelin the default implementation- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the text or
nullif no text has to be displayed
-
setBackgroundColor
- Parameters:
backgroundColor- theColorornullif default background color (SWT.COLOR_INFO_BACKGROUND) should be used
-
setBackgroundImage
- Parameters:
backgroundImage- theImageornullif no image should be displayed in the background
-
setFont
- Parameters:
font- theFontornullif the default font should be used
-
setForegroundColor
- Parameters:
foregroundColor- theColorornullif default foreground color should be used
-
setImage
- Parameters:
image- theImageornullif no image should be displayed
-
setStyle
public void setStyle(int style) The style used to create theCLabelin the default implementation- Parameters:
style- the event triggered the popup of the tooltip
-
setText
The text displayed in theCLabelin the default implementation- Parameters:
text- the text ornullif no text has to be displayed
-