private static @Nullable Window getWindow(@NotNull Component component) {
    if (component instanceof Window) {
      return (Window)component;
    }

    final Window window = SwingUtilities.windowForComponent(component);
    if (window == null) {
      // NOTE: it's possible for SheetMessage$JPanel
      LOG.debug("can't find window for component: %s", component);
    }
    return window;
  }
private static @Nullable Window getWindow(@NotNull Component component)