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 CompositecreateToolTipContentArea(Event event, Composite parent)Creates the content are of the the tooltip.protected ColorgetBackgroundColor(Event event)protected ImagegetBackgroundImage(Event event)protected FontgetFont(Event event)protected ColorgetForegroundColor(Event event)protected ImagegetImage(Event event)protected intgetStyle(Event event)The style used to create theCLabelin the default implementationprotected StringgetText(Event event)The text displayed in theCLabelin the default implementationvoidsetBackgroundColor(Color backgroundColor)voidsetBackgroundImage(Image backgroundImage)voidsetFont(Font font)voidsetForegroundColor(Color foregroundColor)voidsetImage(Image image)voidsetStyle(int style)The style used to create theCLabelin the default implementationvoidsetText(String text)The text displayed in theCLabelin 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-trueif 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:
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
protected int getStyle(Event event)
The style used to create theCLabelin 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
Imageornullif no image should be displayed
-
getForegroundColor
protected Color getForegroundColor(Event event)
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Colorornullif default foreground color should be used
-
getBackgroundColor
protected Color getBackgroundColor(Event event)
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Colorornullif default background color should be used
-
getBackgroundImage
protected Image getBackgroundImage(Event event)
- Parameters:
event- the event triggered the popup of the tooltip- Returns:
- the
Imageornullif 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
Fontornullif the default font should be used
-
getText
protected String getText(Event event)
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
public void setBackgroundColor(Color backgroundColor)
- Parameters:
backgroundColor- theColorornullif default background color (SWT.COLOR_INFO_BACKGROUND) should be used
-
setBackgroundImage
public void setBackgroundImage(Image backgroundImage)
- Parameters:
backgroundImage- theImageornullif no image should be displayed in the background
-
setFont
public void setFont(Font font)
- Parameters:
font- theFontornullif the default font should be used
-
setForegroundColor
public void setForegroundColor(Color foregroundColor)
- Parameters:
foregroundColor- theColorornullif default foreground color should be used
-
setImage
public void setImage(Image image)
- 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
-
-