Class ColumnViewerToolTipSupport


public class ColumnViewerToolTipSupport extends DefaultToolTip
The ColumnViewerTooltipSupport is the class that provides tool tips for ColumnViewers.
Since:
3.3
  • Constructor Details

    • ColumnViewerToolTipSupport

      protected ColumnViewerToolTipSupport(ColumnViewer viewer, int style, boolean manualActivation)
      Enable ToolTip support for the viewer by creating an instance from this class. To get all necessary informations this support class consults the CellLabelProvider.
      Parameters:
      viewer - the viewer the support is attached to
      style - style passed to control tool tip behavior
      manualActivation - true if the activation is done manually using ToolTip.show(Point)
  • Method Details

    • enableFor

      public static void enableFor(ColumnViewer viewer)
      Enable ToolTip support for the viewer by creating an instance from this class. To get all necessary informations this support class consults the CellLabelProvider.
      Parameters:
      viewer - the viewer the support is attached to
    • enableFor

      public static void enableFor(ColumnViewer viewer, int style)
      Enable ToolTip support for the viewer by creating an instance from this class. To get all necessary informations this support class consults the CellLabelProvider.
      Parameters:
      viewer - the viewer the support is attached to
      style - style passed to control tool tip behavior
      See Also:
    • getToolTipArea

      protected Object getToolTipArea(Event event)
      Description copied from class: ToolTip
      This method is called to check for which area the tooltip is created/hidden for. In case of ToolTip.NO_RECREATE this is used to decide if the tooltip is hidden recreated. By the default it is the widget the tooltip is created for but could be any object. To decide if the area changed the Object.equals(Object) method is used.
      Overrides:
      getToolTipArea in class ToolTip
      Parameters:
      event - the event
      Returns:
      the area responsible for the tooltip creation or null this could be any object describing the area (e.g. the Control onto which the tooltip is bound to, a part of this area e.g. for ColumnViewer this could be a ViewerCell)
    • createToolTipContentArea

      protected Composite createToolTipContentArea(Event event, Composite parent)
      Instead of overwriting this method subclasses should overwrite createViewerToolTipContentArea(Event, ViewerCell, Composite)
      Overrides:
      createToolTipContentArea in class DefaultToolTip
      Parameters:
      event - the event that triggered the activation of the tooltip
      parent - the parent of the content area
      Returns:
      the content area created
    • createViewerToolTipContentArea

      protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent)
      Creates the content area of the tool tip giving access to the cell the tip is shown for. Subclasses can overload this method to implement their own tool tip design.

      This method is called from createToolTipContentArea(Event, Composite) and by default calls the DefaultToolTip.createToolTipContentArea(Event, Composite).

      Parameters:
      event - the event that which
      cell - the cell the tool tip is shown for
      parent - the parent of the control to create
      Returns:
      the control to be displayed in the tool tip area
      Since:
      3.4
    • shouldCreateToolTip

      protected boolean shouldCreateToolTip(Event event)
      Description copied from class: ToolTip
      Should the tooltip displayed because of the given event.

      Subclasses may overwrite this to get custom behavior

      Overrides:
      shouldCreateToolTip in class ToolTip
      Parameters:
      event - the event
      Returns:
      true if tooltip should be displayed
    • afterHideToolTip

      protected void afterHideToolTip(Event event)
      Description copied from class: ToolTip
      This method is called after a tooltip is hidden.

      Subclasses may override to clean up requested system resources

      Overrides:
      afterHideToolTip in class ToolTip
      Parameters:
      event - event triggered the hiding action (may be null if event wasn't triggered by user actions directly)