public static @NotNull Component getFocusedComponentInWindowOrSelf(@NotNull Component component) {
    Window window = ComponentUtil.getWindow(component);
    Component focusedComponent = window == null ? null : WindowManagerEx.getInstanceEx().getFocusedComponent(window);
    return focusedComponent != null ? focusedComponent : component;
  }
public static @NotNull Component getFocusedComponentInWindowOrSelf(@NotNull Component component)