Class IzToolTipImpl


public class IzToolTipImpl extends DefaultToolTip
The tooltip implementor class controlled by IzToolTip.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • IzToolTipImpl

      public IzToolTipImpl(Control control, boolean useHideTimeout)
      Constructs the tooltip.
      Parameters:
      control - The owner of the tooltip.
      useHideTimeout - true to hide the tooltip after a timeout, false to leave it shown.
    • IzToolTipImpl

      public IzToolTipImpl(Control control, boolean useRegions, boolean useHideTimeout)
      Constructs the tooltip.
      Parameters:
      control - The owner of the tooltip.
      useRegions - true to keep the tooltip shell between shows, false to recreate it each time.
      useHideTimeout - true to hide the tooltip after a timeout, false to leave it shown.
  • Method Details

    • setHideTimeout

      public void setHideTimeout(boolean on)
      Sets using hide timeout.
    • createToolTipContentArea

      protected Composite createToolTipContentArea(Event event, Composite parent)
      Creates the tooltip content area for HTML.
      Overrides:
      createToolTipContentArea in class DefaultToolTip
    • ksetText

      public void ksetText(String text, int type)
      Sets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.
    • setText

      public void setText(String text, int type, KStringInfoProviderAdapter adapter)
      Sets the text, type is 0=normal text, 1=text with fixed font, 2=text in HTML.
    • setProperty

      public void setProperty(DesignerProp dp)
      Sets the DesignerProp as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.
    • setProperty

      public void setProperty(DesignerProp dp, IzToolTipPropEnhancer enhancer)
      Sets the DesignerProp as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.
    • setProperty

      public void setProperty(GProp<?> gp)
      Sets the property as the tooltip creator for the contents area. This will cancel tooltip text as text/HTML.
    • setJavaMember

      public void setJavaMember(org.eclipse.jdt.core.IMember member)
      Sets a Java member to show as HTML from its JavaDoc.
    • createJavaDocComposite

      public static Composite createJavaDocComposite(Composite topMost, Composite parent, org.eclipse.jdt.core.IMember member)
      Creates a JavaDoc tooltip composite for a member.
      Parameters:
      topMost - The top-most composite, forwarded to createTooltipComposite, which does not consult it.
      parent - The parent composite.
      member - The member.
      Returns:
      null if not possible.
    • markNoBrowser

      public static void markNoBrowser(Composite content)
      Marks the tooltip shell of a content composite: a Browser of the content could not be created (e.g. WebView2's creation timed out). The hosts that hide such a tooltip (hideWhenNoBrowser(Composite, Runnable), takeNoBrowser(Composite)) then show nothing, and the next hover tries again. Called by createTooltipComposite(Composite, Composite, String, int, boolean) for the HTML and JavaDoc tooltips, and by a content whose own Browser failed (the image preview of a component).
      Parameters:
      content - A composite of the tooltip's content (its shell is the tooltip shell).
    • takeNoBrowser

      public static boolean takeNoBrowser(Composite content)
      Whether the content created in a tooltip shell holds no Browser: the shell of content carries the marker of markNoBrowser(Composite). The marker is taken (cleared), so that a shell shown again later with a new content is judged by that content.
      Parameters:
      content - A composite of the tooltip's content (its shell is the tooltip shell).
      Returns:
      true when a Browser of the content could not be created.
    • hideWhenNoBrowser

      public static boolean hideWhenNoBrowser(Composite content, Runnable hide)
      Hides a tooltip whose content holds no Browser the way an IzToolTipImpl hides its own: when the shell of content carries the marker of markNoBrowser(Composite) (taken, see takeNoBrowser(Composite)), hide runs in the shell's Show event, where SWT allows the shell to be disposed of, so that nothing is shown and the next hover tries again.
      Parameters:
      content - A composite of the tooltip's content (its shell is the tooltip shell).
      hide - What hides the tooltip, e.g. a JFace ToolTip's hide().
      Returns:
      true when the tooltip will be hidden.
    • createHTMLComposite

      public static Composite createHTMLComposite(Composite topMost, Composite parent, KString kstring, KStringInfoProviderAdapter adapter)
      Creates a HTML composite for HTML preview.