Package org.eclipse.jface.window
Class DefaultToolTip
- java.lang.Object
-
- org.eclipse.jface.window.ToolTip
-
- org.eclipse.jface.window.DefaultToolTip
-
- Direct Known Subclasses:
ColumnViewerToolTipSupport
public class DefaultToolTip extends ToolTip
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
Constructors Constructor Description DefaultToolTip(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
getFont(Event event)
protected Color
getForegroundColor(Event event)
protected Image
getImage(Event event)
protected int
getStyle(Event event)
The style used to create theCLabel
in the default implementationprotected String
getText(Event event)
The text displayed in theCLabel
in the default implementationvoid
setBackgroundColor(Color backgroundColor)
void
setBackgroundImage(Image backgroundImage)
void
setFont(Font font)
void
setForegroundColor(Color foregroundColor)
void
setImage(Image image)
void
setStyle(int style)
The style used to create theCLabel
in the default implementationvoid
setText(String text)
The text displayed in theCLabel
in the default implementation-
Methods 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 Detail
-
DefaultToolTip
public DefaultToolTip(Control control)
Create new instance which add TooltipSupport to the widget- Parameters:
control
- the control on whose action the tooltip is shown
-
DefaultToolTip
public DefaultToolTip(Control control, int style, boolean manualActivation)
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:
ToolTip.RECREATE
,ToolTip.NO_RECREATE
-
-
Method Detail
-
createToolTipContentArea
protected Composite createToolTipContentArea(Event event, Composite parent)
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
protected int getStyle(Event event)
The style used to create theCLabel
in the default implementation- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the style
-
getImage
protected Image getImage(Event event)
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Image
ornull
if no image should be displayed
-
getForegroundColor
protected Color getForegroundColor(Event event)
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Color
ornull
if default foreground color should be used
-
getBackgroundColor
protected Color getBackgroundColor(Event event)
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Color
ornull
if default background color should be used
-
getBackgroundImage
protected Image getBackgroundImage(Event event)
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Image
ornull
if no image should be displayed in the background
-
getFont
protected Font getFont(Event event)
- Parameters:
event
- the event triggered the popup of the tooltip- Returns:
- the
Font
ornull
if the default font should be used
-
getText
protected String getText(Event event)
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
public void setBackgroundColor(Color backgroundColor)
- Parameters:
backgroundColor
- theColor
ornull
if default background color (SWT.COLOR_INFO_BACKGROUND
) should be used
-
setBackgroundImage
public void setBackgroundImage(Image backgroundImage)
- Parameters:
backgroundImage
- theImage
ornull
if no image should be displayed in the background
-
setFont
public void setFont(Font font)
- Parameters:
font
- theFont
ornull
if the default font should be used
-
setForegroundColor
public void setForegroundColor(Color foregroundColor)
- Parameters:
foregroundColor
- theColor
ornull
if default foreground color should be used
-
setImage
public void setImage(Image image)
- 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
-
-