EA-80750 - assert: AnAction.setShortcutSet

before this fix, it worked only for the first search field in IDE, because after the first time the shortcut is no longer empty (we registered it), and action was not registered on component any more.
This commit is contained in:
Aleksey Pivovarov
2016-03-17 19:17:07 +03:00
parent f94a753e21
commit 0234922fd0
2 changed files with 3 additions and 6 deletions
@@ -18,7 +18,6 @@ package com.intellij.ui;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.CommonShortcuts;
import com.intellij.openapi.actionSystem.IdeActions;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.ui.JBMenuItem;
@@ -204,9 +203,7 @@ public class SearchTextField extends JPanel {
final ActionManager actionManager = ActionManager.getInstance();
if (actionManager != null) {
final AnAction clearTextAction = actionManager.getAction(IdeActions.ACTION_CLEAR_TEXT);
if (clearTextAction.getShortcutSet().getShortcuts().length == 0) {
clearTextAction.registerCustomShortcutSet(CommonShortcuts.ESCAPE, this);
}
clearTextAction.registerCustomShortcutSet(clearTextAction.getShortcutSet(), this);
}
}
}
@@ -15,9 +15,9 @@
<action id="FullyExpandTreeNode">
<keyboard-shortcut first-keystroke="MULTIPLY"/>
</action>
<!--<action id="TextComponent.ClearAction">
<action id="TextComponent.ClearAction">
<keyboard-shortcut first-keystroke="ESCAPE"/>
</action>-->
</action>
<action id="ExpandTreeNode">
<keyboard-shortcut first-keystroke="ADD"/>
</action>