static JEditorPane initPane(@NonNls String text, final HintHint hintHint, JLayeredPane layeredPane) {
final Ref<Dimension> prefSize = new Ref<Dimension>(null);
text = "<html><head>" +
- UIUtil.getCssFontDeclaration(hintHint.getTextFont(), hintHint.getTextForeground()) +
+ UIUtil.getCssFontDeclaration(hintHint.getTextFont(), hintHint.getTextForeground(), hintHint.getLinkForeground()) +
"</head><body>" +
getHtmlBody(text) +
"</body></html>";
return useGraphite(awtTooltip) ? Color.white : UIManager.getColor("ToolTip.foreground");
}
+ public Color getLinkForeground(boolean awtTooltip) {
+ return useGraphite(awtTooltip) ? new Color(209, 209, 255) : Color.blue;
+ }
+
public Color getTextBackground(boolean awtTooltip) {
return useGraphite(awtTooltip) ? new Color(100, 100, 100, 230) : UIManager.getColor("ToolTip.background");
}
hideCurrent(null);
}
}
+
}
return getTooltipManager().getTextBackground(myAwtTooltip);
}
+ public Color getLinkForeground() {
+ return getTooltipManager().getLinkForeground(myAwtTooltip);
+ }
+
public boolean isOwnBorderAllowed() {
return getTooltipManager().isOwnBorderAllowed(myAwtTooltip);
}
@NonNls
public static String getCssFontDeclaration(final Font font) {
- return getCssFontDeclaration(font, null);
+ return getCssFontDeclaration(font, null, null);
}
@NonNls
- public static String getCssFontDeclaration(final Font font, @Nullable Color fgColor) {
- return "<style> body, div, td { font-family: " + font.getFamily() + "; font-size: " + font.getSize() + "; " + (fgColor != null ? "color:" + ColorUtil.toHex(fgColor) : "") + " } </style>";
+ public static String getCssFontDeclaration(final Font font, @Nullable Color fgColor, @Nullable Color linkColor) {
+ String fontFamilyAndSize = "font-family:" + font.getFamily() + "; font-size:" + font.getSize() + ";";
+ String body = "body, div, td {" + fontFamilyAndSize + " " + (fgColor != null ? "color:" + ColorUtil.toHex(fgColor) : "") + "}";
+ String link = (linkColor != null ? ("a {" + fontFamilyAndSize + " color:" + ColorUtil.toHex(linkColor) + "") : "") + "}";
+ return "<style> " + body + " " + link + "</style>";
}
public static boolean isWinLafOnVista() {