void (@NotNull AnActionEvent e) { Component focusOwner = IdeFocusManager.getInstance(myProject).getFocusOwner(); if (UIUtil.isAncestor(SearchReplaceComponent.this, focusOwner)) focusOwner.transferFocus(); }