Class TipUtil

java.lang.Object
org.fife.ui.autocomplete.TipUtil

final class TipUtil extends Object
Static utility methods for homemade tool tips.

This is blatantly ripped off from RSyntaxTextArea's "FocusableTips" class of the same name, but isn't re-used to prevent a hard dependency on the RSTA library.

Version:
1.0
  • Constructor Details

    • TipUtil

      private TipUtil()
  • Method Details

    • getToolTipBackground

      public static Color getToolTipBackground()
      Returns the default background color to use for tool tip windows.
      Returns:
      The default background color.
    • getToolTipBorder

      public static Border getToolTipBorder()
      Returns the border used by tool tips in this look and feel.
      Returns:
      The border.
    • getToolTipHyperlinkForeground

      static Color getToolTipHyperlinkForeground()
      Returns the color to use for hyperlink-style components in tool tips. This method will return Color.blue unless it appears that the current LookAndFeel uses light text on a dark background, in which case a brighter alternative is returned.
      Returns:
      The color to use for hyperlinks in tool tips.
      See Also:
    • isDerivedColor

      private static boolean isDerivedColor(Color c)
      Returns whether a color is a Nimbus DerivedColor, which is troublesome in that it doesn't use its RGB values (uses HSB instead?) and so querying them is useless.
      Parameters:
      c - The color to check.
      Returns:
      Whether it is a DerivedColor
    • isNimbusLookAndFeel

      private static boolean isNimbusLookAndFeel()
      Returns whether the Nimbus Look and Feel is installed.
      Returns:
      Whether the current LAF is Nimbus.
    • tweakTipEditorPane

      public static void tweakTipEditorPane(JEditorPane textArea)
      Tweaks a JEditorPane so it can be used to render the content in a focusable pseudo-tool tip. It is assumed that the editor pane is using an HTMLDocument.
      Parameters:
      textArea - The editor pane to tweak.