Commit 9473d00a authored by Alexandr Suhinin's avatar Alexandr Suhinin
Browse files

fix: process settings link on inspection toolwindow

IDEA-208728
parent b450c38b
Showing with 17 additions and 5 deletions
+17 -5
......@@ -7,16 +7,15 @@ import com.intellij.codeInspection.actions.RunInspectionAction;
import com.intellij.codeInspection.ex.InspectionProfileImpl;
import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.diagnostic.PluginException;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.actions.ShowSettingsUtilImpl;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
import com.intellij.profile.codeInspection.ui.SingleInspectionProfilePanel;
import com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionsConfigTreeTable;
import com.intellij.ui.BrowserHyperlinkListener;
import com.intellij.ui.ClickListener;
import com.intellij.ui.JBColor;
import com.intellij.ui.ScrollPaneFactory;
import com.intellij.ui.*;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBLabelDecorator;
import com.intellij.ui.components.panels.StatelessCardLayout;
......@@ -26,6 +25,7 @@ import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.regex.Matcher;
......@@ -68,7 +68,19 @@ public class InspectionNodeInfo extends JPanel {
description.setEditable(false);
description.setOpaque(false);
description.setBackground(UIUtil.getLabelBackground());
description.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
description.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
String prefix = SingleInspectionProfilePanel.SETTINGS;
String description = e.getDescription();
if (description.startsWith(prefix)) {
String id = description.substring(prefix.length());
ShowSettingsUtilImpl.showSettingsDialog(project, id, "");
} else {
BrowserUtil.browse(description);
}
}
});
String descriptionText = toolWrapper.loadDescription();
if (descriptionText == null) {
InspectionEP extension = toolWrapper.getExtension();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment