private static Window findWindow(Component component) {
    DialogWrapper dialogWrapper = DialogWrapper.findInstance(component);
    if (dialogWrapper != null) {
      return dialogWrapper.getPeer().getWindow();
    }
    return null;
  }
private static Window findWindow(Component component)