private static boolean isFromDialog(@Nullable Project project) {
    return DialogWrapper.findInstance(IdeFocusManager.getInstance(project).getFocusOwner()) != null;
  }
private static boolean isFromDialog(@Nullable Project project)