From bb4f76f2786eb7223cecd8ee5e7a34c0fa74e999 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Wed, 20 Apr 2016 09:49:10 +0300 Subject: [PATCH] inspection tool window: temp fix for funny looking inspection description --- .../intellij/codeInspection/ui/InspectionNodeInfo.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java index d9c3df9dd8bc..3b47177d233a 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionNodeInfo.java @@ -19,7 +19,9 @@ import com.intellij.codeInsight.daemon.HighlightDisplayKey; import com.intellij.codeInspection.ex.DisableInspectionToolAction; import com.intellij.codeInspection.ex.InspectionProfileImpl; import com.intellij.codeInspection.ex.InspectionToolWrapper; +import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.registry.Registry; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel; import com.intellij.ui.*; @@ -38,6 +40,7 @@ import java.awt.event.MouseEvent; * @author Dmitry Batkovich */ public class InspectionNodeInfo extends JPanel { + private final static Logger LOG = Logger.getInstance(InspectionNodeInfo.class); private final JButton myButton; private final JBLabel myEnabledLabel; private final HighlightDisplayKey myKey; @@ -51,9 +54,10 @@ public class InspectionNodeInfo extends JPanel { setLayout(new GridBagLayout()); setBorder(IdeBorderFactory.createEmptyBorder(11, 0, 0, 0)); final InspectionToolWrapper toolWrapper = tree.getSelectedToolWrapper(); + LOG.assertTrue(toolWrapper != null); myProject = project; myCurrentProfile = (InspectionProfileImpl)InspectionProjectProfileManager.getInstance(project).getProjectProfileImpl(); - myKey = HighlightDisplayKey.find(toolWrapper.getID()); + myKey = HighlightDisplayKey.find(toolWrapper.getShortName()); myButton = new JButton(); JPanel titlePanel = new JPanel(); @@ -74,6 +78,10 @@ public class InspectionNodeInfo extends JPanel { description.setContentType(UIUtil.HTML_MIME); description.setEditable(false); description.setOpaque(false); + if (Registry.is("ide.scroll.background.auto")) { + description.setBackground(UIUtil.getLabelBackground()); + description.setForeground(UIUtil.getLabelForeground()); + } description.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE); final String toolDescription = toolWrapper.loadDescription(); SingleInspectionProfilePanel.readHTML(description, SingleInspectionProfilePanel.toHTML(description, toolDescription == null ? "" : toolDescription, false));