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
  • Constructor Details

    • 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 bound
      style - style passed to control tooltip behaviour
      manualActivation - true if the activation is done manually using ToolTip.show(Point)
      See Also:
  • Method Details

    • 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 class ToolTip
      Parameters:
      event - the event that triggered the activation of the tooltip
      parent - the parent of the content area
      Returns:
      the content area created
    • getStyle

      protected int getStyle(Event event)
      The style used to create the CLabel in the default implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the style
    • getImage

      protected Image getImage(Event event)
      The Image displayed in the CLabel in the default implementation implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the Image or null if no image should be displayed
    • getForegroundColor

      protected Color getForegroundColor(Event event)
      The foreground Color used by CLabel in the default implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the Color or null if default foreground color should be used
    • getBackgroundColor

      protected Color getBackgroundColor(Event event)
      The background Color used by CLabel in the default implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the Color or null if default background color should be used
    • getBackgroundImage

      protected Image getBackgroundImage(Event event)
      The background Image used by CLabel in the default implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the Image or null if no image should be displayed in the background
    • getFont

      protected Font getFont(Event event)
      The Font used by CLabel in the default implementation
      Parameters:
      event - the event triggered the popup of the tooltip
      Returns:
      the Font or null if the default font should be used
    • getText

      protected String getText(Event event)
      The text displayed in the CLabel 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)
      The background Image used by CLabel in the default implementation
      Parameters:
      backgroundColor - the Color or null if default background color (SWT.COLOR_INFO_BACKGROUND) should be used
    • setBackgroundImage

      public void setBackgroundImage(Image backgroundImage)
      The background Image used by CLabel in the default implementation
      Parameters:
      backgroundImage - the Image or null if no image should be displayed in the background
    • setFont

      public void setFont(Font font)
      The Font used by CLabel in the default implementation
      Parameters:
      font - the Font or null if the default font should be used
    • setForegroundColor

      public void setForegroundColor(Color foregroundColor)
      The foreground Color used by CLabel in the default implementation
      Parameters:
      foregroundColor - the Color or null if default foreground color should be used
    • setImage

      public void setImage(Image image)
      The Image displayed in the CLabel in the default implementation implementation
      Parameters:
      image - the Image or null if no image should be displayed
    • setStyle

      public void setStyle(int style)
      The style used to create the CLabel in the default implementation
      Parameters:
      style - the event triggered the popup of the tooltip
    • setText

      public void setText(String text)
      The text displayed in the CLabel in the default implementation
      Parameters:
      text - the text or null if no text has to be displayed