From 0d4c372a7df9567cbfc7484d4f581cd7c12898e4 Mon Sep 17 00:00:00 2001 From: Louis Vignier Date: Tue, 12 Jan 2021 23:33:22 +0100 Subject: [PATCH] IDEA-185794 Implement inspection severity mnemonic #IDEA-185794 Fixed GitOrigin-RevId: b64d97f16155c04c20c6cfecb0b619ee045c91b6 --- .../ui/SingleInspectionProfilePanel.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java index e608f7ea5221..f913d2a373ba 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java @@ -30,6 +30,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.JDOMUtil; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.profile.ProfileChangeAdapter; import com.intellij.profile.codeInspection.BaseInspectionProfileManager; @@ -71,6 +72,8 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; import java.io.IOException; import java.io.StringReader; import java.net.URI; @@ -567,7 +570,6 @@ public class SingleInspectionProfilePanel extends JPanel { } }); - myTreeTable.addMouseListener(new PopupHandler() { @Override public void invokePopup(Component comp, int x, int y) { @@ -581,6 +583,14 @@ public class SingleInspectionProfilePanel extends JPanel { } }); + int modifiers = SystemInfo.isMac ? InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK; + + registerKeyboardAction(__ -> { + if (myTreeTable.getStrictlySelectedToolNode() != null) { + final Container parent = myTreeTable.getParent(); + compoundPopup().show(parent, parent.getWidth() / 2, parent.getHeight() / 2); + } + }, KeyStroke.getKeyStroke(KeyEvent.VK_V, modifiers), WHEN_IN_FOCUSED_WINDOW); new TreeSpeedSearch(tree, o -> { final InspectionConfigTreeNode node = (InspectionConfigTreeNode)o.getLastPathComponent();