private static AbstractDialog createDialog(boolean headless, Window owner, DialogWrapper wrapper, Project project, DialogWrapper.IdeModalityType ideModalityType) {
    if (headless) {
      return new HeadlessDialog(wrapper);
    }
    else {
      var dialog = new MyDialog(OwnerOptional.findOwner(owner), wrapper, project);
      dialog.setModalityType(ideModalityType.toAwtModality());
      return dialog;
    }
  }
private static AbstractDialog createDialog(boolean headless, Window owner, DialogWrapper wrapper, Project project, DialogWrapper.IdeModalityType ideModalityType)