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
ConstructorDescriptionDefaultToolTip
(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 Composite
createToolTipContentArea
(Event event, Composite parent) Creates the content are of the the tooltip.protected Color
getBackgroundColor
(Event event) protected Image
getBackgroundImage
(Event event) protected Font
protected Color
getForegroundColor
(Event event) protected Image
protected int
The style used to create theCLabel
in the default implementationprotected String
The text displayed in theCLabel
in the default implementationvoid
setBackgroundColor
(Color backgroundColor) void
setBackgroundImage
(Image backgroundImage) void
void
setForegroundColor
(Color foregroundColor) void
void
setStyle
(int style) The style used to create theCLabel
in the default implementationvoid
The text displayed in theCLabel
in 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
-true
if 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:
createToolTipContentArea
in 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 theCLabel
in 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
Image
ornull
if no image should be displayed
-
getForegroundColor
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Color
ornull
if default foreground color should be used
-
getBackgroundColor
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Color
ornull
if default background color should be used
-
getBackgroundImage
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Image
ornull
if no image should be displayed in the background
-
getFont
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Font
ornull
if the default font should be used
-
getText
The text displayed in theCLabel
in the default implementation- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the text or
null
if no text has to be displayed
-
setBackgroundColor
- Parameters:
backgroundColor
- theColor
ornull
if default background color (SWT.COLOR_INFO_BACKGROUND
) should be used
-
setBackgroundImage
- Parameters:
backgroundImage
- theImage
ornull
if no image should be displayed in the background
-
setFont
- Parameters:
font
- theFont
ornull
if the default font should be used
-
setForegroundColor
- Parameters:
foregroundColor
- theColor
ornull
if default foreground color should be used
-
setImage
- Parameters:
image
- theImage
ornull
if no image should be displayed
-
setStyle
public void setStyle(int style) The style used to create theCLabel
in the default implementation- Parameters:
style
- the event triggered the popup of the tooltip
-
setText
The text displayed in theCLabel
in the default implementation- Parameters:
text
- the text ornull
if no text has to be displayed
-