@Override
      public void update(@NotNull AnActionEvent e) {
        Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
        e.getPresentation().setEnabled(owner instanceof JButton && owner.isEnabled());
      }
@Override
      public void update(@NotNull AnActionEvent e)