@Override
  public final void focusGained(final FocusEvent e) {
    final Component component = e.getComponent();
    if (e.isTemporary() || !component.isShowing()) {
      return;
    }
    if (component instanceof JTextComponent textComponent && textComponent.isEditable()) {
      SwingUndoUtil.addUndoRedoActions(textComponent);
    }
    setFocusedComponentImpl(component, e);
  }
@Override
  public final void focusGained(final FocusEvent e)