Package org.fife.ui.autocomplete
Class TipUtil
java.lang.Object
org.fife.ui.autocomplete.TipUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Color
Returns the default background color to use for tool tip windows.static Border
Returns the border used by tool tips in this look and feel.(package private) static Color
Returns the color to use for hyperlink-style components in tool tips.private static boolean
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.private static boolean
Returns whether the Nimbus Look and Feel is installed.static void
tweakTipEditorPane
(JEditorPane textArea) Tweaks aJEditorPane
so it can be used to render the content in a focusable pseudo-tool tip.
-
Constructor Details
-
TipUtil
private TipUtil()
-
-
Method Details
-
getToolTipBackground
Returns the default background color to use for tool tip windows.- Returns:
- The default background color.
-
getToolTipBorder
Returns the border used by tool tips in this look and feel.- Returns:
- The border.
-
getToolTipHyperlinkForeground
Returns the color to use for hyperlink-style components in tool tips. This method will returnColor.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
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
Tweaks aJEditorPane
so it can be used to render the content in a focusable pseudo-tool tip. It is assumed that the editor pane is using anHTMLDocument
.- Parameters:
textArea
- The editor pane to tweak.
-