boolean () { new AnAction() { { setEnabledInModalContext(true); } @Override public void update(@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!getText().isEmpty()); } @Override public @NotNull ActionUpdateThread getActionUpdateThread() { return ActionUpdateThread.EDT; } @Override public void actionPerformed(@NotNull AnActionEvent e) { if (mySearchPanel.controller != null && mySearchPanel.controller.isPopupShow()) { mySearchPanel.controller.hidePopup(); } else { setText(""); } } }.registerCustomShortcutSet(CommonShortcuts.ESCAPE, this); return false; }