diff --git a/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupElementPresentation.java b/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupElementPresentation.java index fb1d4dc2811b..5afceab2af5f 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupElementPresentation.java +++ b/platform/lang-api/src/com/intellij/codeInsight/lookup/LookupElementPresentation.java @@ -36,7 +36,7 @@ public class LookupElementPresentation { private String myItemText; private String myTypeText; private boolean myStrikeout; - private Color myItemTextForeground = JBColor.foreground; + private Color myItemTextForeground = JBColor.foreground(); private boolean myItemTextBold; private boolean myItemTextUnderlined; private boolean myTypeGrayed; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java index 251d1b4552a3..0a3db75510fb 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java @@ -40,7 +40,7 @@ class ParameterInfoComponent extends JPanel{ private final OneElementComponent[] myPanels; private static final Color BACKGROUND_COLOR = HintUtil.INFORMATION_COLOR; - private static final Color FOREGROUND_COLOR = JBColor.foreground; + private static final Color FOREGROUND_COLOR = JBColor.foreground(); // private static final Color DISABLED_BACKGROUND_COLOR = HintUtil.INFORMATION_COLOR; private static final Color DISABLED_FOREGROUND_COLOR = Gray._128; private static final Color HIGHLIGHTED_BORDER_COLOR = new JBColor(new Color(231, 254, 234), Gray._100); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java index 2d39912b6cbc..8124c1d4df25 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java @@ -54,13 +54,13 @@ public class LookupCellRenderer implements ListCellRenderer { private final FontMetrics myNormalMetrics; private final FontMetrics myBoldMetrics; - public static final Color BACKGROUND_COLOR = new JBColor(new Color(235, 244, 254), JBColor.background); - private static final Color FOREGROUND_COLOR = JBColor.foreground; + public static final Color BACKGROUND_COLOR = new JBColor(new Color(235, 244, 254), JBColor.background()); + private static final Color FOREGROUND_COLOR = JBColor.foreground(); private static final Color GRAYED_FOREGROUND_COLOR = new JBColor(Gray._160, Gray._110); private static final Color SELECTED_BACKGROUND_COLOR = new Color(0, 82, 164); private static final Color SELECTED_NON_FOCUSED_BACKGROUND_COLOR = new JBColor(new Color(110, 142, 162), new Color(85, 88, 90)); - private static final Color SELECTED_FOREGROUND_COLOR = new JBColor(JBColor.WHITE, JBColor.foreground); - private static final Color SELECTED_GRAYED_FOREGROUND_COLOR = new JBColor(JBColor.WHITE, JBColor.foreground); + private static final Color SELECTED_FOREGROUND_COLOR = new JBColor(JBColor.WHITE, JBColor.foreground()); + private static final Color SELECTED_GRAYED_FOREGROUND_COLOR = new JBColor(JBColor.WHITE, JBColor.foreground()); static final Color PREFIX_FOREGROUND_COLOR = new JBColor(new Color(176, 0, 176), new Color(209, 122, 214)); private static final Color SELECTED_PREFIX_FOREGROUND_COLOR = new JBColor(new Color(249, 236, 204), new Color(209, 122, 214)); @@ -346,7 +346,7 @@ public class LookupCellRenderer implements ListCellRenderer { } myTypeLabel.setBackground(sampleBackground); - myTypeLabel.setForeground(presentation.isTypeGrayed() ? getGrayedForeground(selected) : item instanceof EmptyLookupItem ? JBColor.foreground : foreground); + myTypeLabel.setForeground(presentation.isTypeGrayed() ? getGrayedForeground(selected) : item instanceof EmptyLookupItem ? JBColor.foreground() : foreground); return used; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java index 758b90f663bb..2f8e9cb7e779 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java @@ -217,7 +217,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable addListeners(); - mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background))); + mySortingLabel.setBorder(new LineBorder(new JBColor(Color.LIGHT_GRAY, JBColor.background()))); mySortingLabel.setOpaque(true); new ChangeLookupSorting().installOn(mySortingLabel); updateSorting(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java index b9eae5413443..ef185d826a88 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java @@ -296,7 +296,7 @@ public class IncrementalSearchHandler { data.label.setForeground(JBColor.RED); } else { - data.label.setForeground(JBColor.foreground); + data.label.setForeground(JBColor.foreground()); if (matchLength > 0) { TextAttributes attributes = editor.getColorsScheme().getAttributes(EditorColors.SEARCH_RESULT_ATTRIBUTES); data.segmentHighlighter = editor.getMarkupModel() @@ -327,7 +327,7 @@ public class IncrementalSearchHandler { public MyLabel(String text) { super(text); this.setBackground(HintUtil.INFORMATION_COLOR); - this.setForeground(JBColor.foreground); + this.setForeground(JBColor.foreground()); this.setOpaque(true); } } diff --git a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java index 296fd76c44a8..c4444b0a8ad9 100644 --- a/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java +++ b/platform/lang-impl/src/com/intellij/ide/bookmarks/Bookmark.java @@ -270,7 +270,7 @@ public class Bookmark implements Navigatable { g.setColor(JBColor.GRAY); g.drawRect(x, y, getIconWidth() - 2, getIconHeight()); - g.setColor(JBColor.foreground); + g.setColor(JBColor.foreground()); final Font oldFont = g.getFont(); g.setFont(MNEMONIC_FONT); diff --git a/platform/lang-impl/src/com/intellij/ide/commander/CommanderPanel.java b/platform/lang-impl/src/com/intellij/ide/commander/CommanderPanel.java index 8b17215783bc..6e451aacff91 100644 --- a/platform/lang-impl/src/com/intellij/ide/commander/CommanderPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/commander/CommanderPanel.java @@ -279,7 +279,7 @@ public class CommanderPanel extends JPanel { myParentTitle = new MyTitleLabel(myTitlePanel); myParentTitle.setText(" "); myParentTitle.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD)); - myParentTitle.setForeground(JBColor.foreground); + myParentTitle.setForeground(JBColor.foreground()); myParentTitle.setUI(new RightAlignedLabelUI()); final JPanel panel1 = new JPanel(new BorderLayout()); panel1.setOpaque(false); @@ -392,7 +392,7 @@ public class CommanderPanel extends JPanel { LOG.assertTrue(color != null); myTitlePanel.setBackground(color); myTitlePanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED, color.brighter(), color.darker())); - myParentTitle.setForeground(JBColor.foreground); + myParentTitle.setForeground(JBColor.foreground()); } final int[] selectedIndices = myList.getSelectedIndices(); if (selectedIndices.length == 0 && myList.getModel().getSize() > 0) { diff --git a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesPanel.java b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesPanel.java index 32a56bdbe14f..e9b4fa0d4c61 100644 --- a/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesPanel.java +++ b/platform/lang-impl/src/com/intellij/packageDependencies/ui/DependenciesPanel.java @@ -765,7 +765,7 @@ public class DependenciesPanel extends JPanel implements Disposable, DataProvide } }); final JEditorPane pane = new JEditorPane(UIUtil.HTML_MIME, "" + buf.toString()+ ""); - pane.setForeground(JBColor.foreground); + pane.setForeground(JBColor.foreground()); pane.setBackground(HintUtil.INFORMATION_COLOR); pane.setOpaque(true); final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(pane); diff --git a/platform/lang-impl/src/com/intellij/ui/ReplacePromptDialog.java b/platform/lang-impl/src/com/intellij/ui/ReplacePromptDialog.java index ffd23f578be3..27622cad5a93 100644 --- a/platform/lang-impl/src/com/intellij/ui/ReplacePromptDialog.java +++ b/platform/lang-impl/src/com/intellij/ui/ReplacePromptDialog.java @@ -90,7 +90,7 @@ public class ReplacePromptDialog extends DialogWrapper { } JLabel label = new JLabel(getMessage()); label.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 10)); - label.setForeground(JBColor.foreground); + label.setForeground(JBColor.foreground()); panel.add(label, BorderLayout.CENTER); return panel; } diff --git a/platform/lang-impl/src/com/intellij/ui/tabs/FileColorConfigurationEditDialog.java b/platform/lang-impl/src/com/intellij/ui/tabs/FileColorConfigurationEditDialog.java index 94bc8b4ecc7f..4e575f2a2f75 100644 --- a/platform/lang-impl/src/com/intellij/ui/tabs/FileColorConfigurationEditDialog.java +++ b/platform/lang-impl/src/com/intellij/ui/tabs/FileColorConfigurationEditDialog.java @@ -272,7 +272,7 @@ public class FileColorConfigurationEditDialog extends DialogWrapper { @Override public Color getForeground() { if (getModel().isSelected()) { - return JBColor.foreground; + return JBColor.foreground(); } else if (getModel().isRollover()) { return JBColor.GRAY; } else { diff --git a/platform/platform-api/src/com/intellij/ide/diff/DirDiffOperation.java b/platform/platform-api/src/com/intellij/ide/diff/DirDiffOperation.java index 3f2ba20aaf81..67487ea7c8a7 100644 --- a/platform/platform-api/src/com/intellij/ide/diff/DirDiffOperation.java +++ b/platform/platform-api/src/com/intellij/ide/diff/DirDiffOperation.java @@ -53,6 +53,6 @@ public enum DirDiffOperation { case EQUAL: case NONE: } - return JBColor.foreground; + return JBColor.foreground(); } } diff --git a/platform/platform-api/src/com/intellij/ui/components/JBTabbedPane.java b/platform/platform-api/src/com/intellij/ui/components/JBTabbedPane.java index 30e3b1fec937..49ad44abf968 100644 --- a/platform/platform-api/src/com/intellij/ui/components/JBTabbedPane.java +++ b/platform/platform-api/src/com/intellij/ui/components/JBTabbedPane.java @@ -92,7 +92,7 @@ public class JBTabbedPane extends JTabbedPane implements HierarchyListener { getTabComponentAt(getSelectedIndex()).setForeground(Color.WHITE); } if (previousSelectedIndex != -1 && getTabComponentAt(previousSelectedIndex) != null) { - getTabComponentAt(previousSelectedIndex).setForeground(JBColor.foreground); + getTabComponentAt(previousSelectedIndex).setForeground(JBColor.foreground()); } } } diff --git a/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java b/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java index 464002e46426..ddb790b2ba11 100644 --- a/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java +++ b/platform/platform-impl/src/com/intellij/codeInsight/hint/HintUtil.java @@ -38,7 +38,7 @@ public class HintUtil { public static final Color QUESTION_COLOR = new JBColor(new Color(181, 208, 251), new Color(55, 108, 137)); public static final Color ERROR_COLOR = new JBColor(new Color(255, 220, 220), new Color(0x781732)); - public static final Color QUESTION_UNDERSCORE_COLOR = JBColor.foreground; + public static final Color QUESTION_UNDERSCORE_COLOR = JBColor.foreground(); private HintUtil() { } @@ -60,7 +60,7 @@ public class HintUtil { if (!hintHint.isAwtTooltip()) { label.setBorder(createHintBorder()); - label.setForeground(JBColor.foreground); + label.setForeground(JBColor.foreground()); label.setFont(getBoldFont()); label.setBackground(INFORMATION_COLOR); label.setOpaque(true); @@ -109,7 +109,7 @@ public class HintUtil { public static JComponent createQuestionLabel(String text) { HintHint hintHint = new HintHint().setTextBg(QUESTION_COLOR) - .setTextFg(JBColor.foreground) + .setTextFg(JBColor.foreground()) .setFont(getBoldFont()) .setAwtTooltip(true); @@ -119,7 +119,7 @@ public class HintUtil { if (!hintHint.isAwtTooltip()) { label.setBorder(createHintBorder()); - label.setForeground(JBColor.foreground); + label.setForeground(JBColor.foreground()); label.setFont(getBoldFont()); label.setBackground(QUESTION_COLOR); label.setOpaque(true); @@ -132,7 +132,7 @@ public class HintUtil { highlighted.setIcon(icon); highlighted.setBackground(INFORMATION_COLOR); - highlighted.setForeground(JBColor.foreground); + highlighted.setForeground(JBColor.foreground()); highlighted.setFont(getBoldFont()); text.appendToComponent(highlighted); @@ -144,7 +144,7 @@ public class HintUtil { public static JComponent createErrorLabel(String text) { HintHint hintHint = new HintHint().setTextBg(ERROR_COLOR) - .setTextFg(JBColor.foreground) + .setTextFg(JBColor.foreground()) .setFont(getBoldFont()) .setAwtTooltip(true); HintLabel label = new HintLabel(); @@ -154,7 +154,7 @@ public class HintUtil { if (!hintHint.isAwtTooltip()) { label.setBorder(createHintBorder() ); - label.setForeground(JBColor.foreground); + label.setForeground(JBColor.foreground()); label.setFont(getBoldFont()); label.setBackground(ERROR_COLOR); label.setOpaque(true); diff --git a/platform/platform-impl/src/com/intellij/ide/IdeTooltipManager.java b/platform/platform-impl/src/com/intellij/ide/IdeTooltipManager.java index 0a95fcfeb3ff..9952cb3d6cb6 100644 --- a/platform/platform-impl/src/com/intellij/ide/IdeTooltipManager.java +++ b/platform/platform-impl/src/com/intellij/ide/IdeTooltipManager.java @@ -600,7 +600,7 @@ public class IdeTooltipManager implements ApplicationComponent, AWTEventListener } public static void setColors(JComponent pane) { - pane.setForeground(JBColor.foreground); + pane.setForeground(JBColor.foreground()); pane.setBackground(HintUtil.INFORMATION_COLOR); pane.setOpaque(true); } diff --git a/platform/util/src/com/intellij/ui/JBColor.java b/platform/util/src/com/intellij/ui/JBColor.java index 3366a40e88bd..d0021bb63fa4 100644 --- a/platform/util/src/com/intellij/ui/JBColor.java +++ b/platform/util/src/com/intellij/ui/JBColor.java @@ -18,22 +18,131 @@ package com.intellij.ui; import com.intellij.util.ui.UIUtil; import java.awt.*; +import java.awt.color.ColorSpace; +import java.awt.geom.AffineTransform; +import java.awt.geom.Rectangle2D; +import java.awt.image.ColorModel; /** * @author Konstantin Bulenkov */ @SuppressWarnings("UseJBColor") public class JBColor extends Color { + + private static boolean DARK = UIUtil.isUnderDarcula(); + + private final Color darkColor; + public JBColor(int rgb, int darkRGB) { - super(isDark() ? darkRGB : rgb); + this(new Color(rgb), new Color(darkRGB)); } public JBColor(Color regular, Color dark) { - super(isDark() ? dark.getRGB() : regular.getRGB(), (isDark() ? dark : regular).getAlpha() != 255); + super(regular.getRGB(), regular.getAlpha() != 255); + darkColor = dark; } - private static boolean isDark() { - return UIUtil.isUnderDarcula(); + public static void setDark(boolean dark) { + DARK = dark; + } + + Color getDarkVariant() { + return darkColor; + } + + @Override + public int getRed() { + return DARK ? getDarkVariant().getRed() : super.getRed(); + } + + @Override + public int getGreen() { + return DARK ? getDarkVariant().getGreen() : super.getGreen(); + } + + @Override + public int getBlue() { + return DARK ? getDarkVariant().getBlue() : super.getBlue(); + } + + @Override + public int getAlpha() { + return DARK ? getDarkVariant().getAlpha() : super.getAlpha(); + } + + @Override + public int getRGB() { + return DARK ? getDarkVariant().getRGB() : super.getRGB(); + } + + @Override + public Color brighter() { + return new JBColor(super.brighter(), getDarkVariant().brighter()); + } + + @Override + public Color darker() { + return new JBColor(super.darker(), getDarkVariant().darker()); + } + + @Override + public int hashCode() { + return DARK ? getDarkVariant().hashCode() : super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + return DARK ? getDarkVariant().equals(obj) : super.equals(obj); + } + + @Override + public String toString() { + return DARK ? getDarkVariant().toString() : super.toString(); + } + + @Override + public float[] getRGBComponents(float[] compArray) { + return DARK ? getDarkVariant().getRGBComponents(compArray) : super.getRGBComponents(compArray); + } + + @Override + public float[] getRGBColorComponents(float[] compArray) { + return DARK ? getDarkVariant().getRGBColorComponents(compArray) : super.getRGBComponents(compArray); + } + + @Override + public float[] getComponents(float[] compArray) { + return DARK ? getDarkVariant().getComponents(compArray) : super.getComponents(compArray); + } + + @Override + public float[] getColorComponents(float[] compArray) { + return DARK ? getDarkVariant().getColorComponents(compArray) : super.getColorComponents(compArray); + } + + @Override + public float[] getComponents(ColorSpace cspace, float[] compArray) { + return DARK ? getDarkVariant().getComponents(cspace, compArray) : super.getComponents(cspace, compArray); + } + + @Override + public float[] getColorComponents(ColorSpace cspace, float[] compArray) { + return DARK ? getDarkVariant().getColorComponents(cspace, compArray) : super.getColorComponents(cspace, compArray); + } + + @Override + public ColorSpace getColorSpace() { + return DARK ? getDarkVariant().getColorSpace() : super.getColorSpace(); + } + + @Override + public synchronized PaintContext createContext(ColorModel cm, Rectangle r, Rectangle2D r2d, AffineTransform xform, RenderingHints hints) { + return DARK ? getDarkVariant().createContext(cm, r, r2d, xform, hints) : super.createContext(cm, r, r2d, xform, hints); + } + + @Override + public int getTransparency() { + return DARK ? getDarkVariant().getTransparency() : super.getTransparency(); } public final static JBColor red = new JBColor(Color.red, DarculaColors.RED); @@ -42,10 +151,20 @@ public class JBColor extends Color { public final static JBColor blue = new JBColor(Color.blue, DarculaColors.BLUE); public final static JBColor BLUE = blue; - public final static JBColor white = new JBColor(Color.white, UIUtil.getListBackground()); + public final static JBColor white = new JBColor(Color.white, UIUtil.getListBackground()) { + @Override + Color getDarkVariant() { + return UIUtil.getListBackground(); + } + }; public final static JBColor WHITE = white; - public final static JBColor black = new JBColor(Color.black, UIUtil.getListForeground()); + public final static JBColor black = new JBColor(Color.black, UIUtil.getListForeground()) { + @Override + Color getDarkVariant() { + return UIUtil.getListForeground(); + } + }; public final static JBColor BLACK = black; public final static JBColor gray = new JBColor(Gray._128, Gray._128); @@ -75,9 +194,7 @@ public class JBColor extends Color { public final static Color cyan = new JBColor(Color.cyan, new Color(0, 137, 137)); public final static Color CYAN = cyan; - public static Color foreground = UIUtil.getLabelForeground(); - public static Color FOREGROUND = foreground; + public static Color foreground() {return UIUtil.getLabelForeground();} - public static Color background = UIUtil.getListBackground(); - public static Color BACKGROUND = background; + public static Color background() {return UIUtil.getListBackground();} } diff --git a/platform/util/src/com/intellij/ui/TitlePanel.java b/platform/util/src/com/intellij/ui/TitlePanel.java index 8ce3b45d15e4..dc660bbbfaaf 100644 --- a/platform/util/src/com/intellij/ui/TitlePanel.java +++ b/platform/util/src/com/intellij/ui/TitlePanel.java @@ -44,7 +44,7 @@ public class TitlePanel extends CaptionPanel { if (UIUtil.isUnderAquaLookAndFeel()) { myLabel.setFont(myLabel.getFont().deriveFont(12f)); } - myLabel.setForeground(JBColor.foreground); + myLabel.setForeground(JBColor.foreground()); myLabel.setHorizontalAlignment(SwingConstants.CENTER); myLabel.setVerticalAlignment(SwingConstants.CENTER); myLabel.setBorder(new EmptyBorder(1, 2, 2, 2)); diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/properties/ClientPropertiesProperty.java b/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/properties/ClientPropertiesProperty.java index 3a618b96ecd0..3b775cd0a329 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/properties/ClientPropertiesProperty.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/propertyInspector/properties/ClientPropertiesProperty.java @@ -79,7 +79,7 @@ public class ClientPropertiesProperty extends ReadOnlyProperty { myTf.setText(UIDesignerBundle.message("client.properties.configure")); myTf.getTextField().setEditable(false); myTf.getTextField().setBorder(null); - myTf.getTextField().setForeground(JBColor.foreground); + myTf.getTextField().setForeground(JBColor.foreground()); myTf.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showClientPropertiesDialog(); diff --git a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAppComponent.java b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAppComponent.java index 6d96250b90b3..cceed7925c71 100644 --- a/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAppComponent.java +++ b/plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathAppComponent.java @@ -195,7 +195,7 @@ public class XPathAppComponent implements ApplicationComponent, JDOMExternalizab label.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.WHITE, Gray._128), BorderFactory.createEmptyBorder(3, 5, 3, 5))); - label.setForeground(JBColor.foreground); + label.setForeground(JBColor.foreground()); label.setBackground(HintUtil.INFORMATION_COLOR); label.setOpaque(true); label.setFont(label.getFont().deriveFont(Font.BOLD)); diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java index 7ce604e475db..59b40c101b58 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/ErrorableTableCellRenderer.java @@ -80,7 +80,7 @@ public class ErrorableTableCellRenderer extends DefaultTab } else if (warningProblems.size() > 0) { component.setBackground(BaseControl.WARNING_BACKGROUND); - if(isSelected) component.setForeground(JBColor.foreground); + if(isSelected) component.setForeground(JBColor.foreground()); } final List errorDescriptors =