use of com.intellij.ide.util.newProjectWizard.AbstractProjectWizard in project intellij-community by JetBrains.
the class ModulesConfigurator method runModuleWizard.
@Nullable
ProjectBuilder runModuleWizard(Component dialogParent, boolean anImport) {
AbstractProjectWizard wizard;
if (anImport) {
wizard = ImportModuleAction.selectFileAndCreateWizard(myProject, dialogParent);
if (wizard == null)
return null;
if (wizard.getStepCount() == 0) {
ProjectBuilder builder = wizard.getProjectBuilder();
Disposer.dispose(wizard.getDisposable());
return builder;
}
} else {
wizard = new NewProjectWizard(myProject, dialogParent, this);
}
if (wizard.showAndGet()) {
final ProjectBuilder builder = wizard.getProjectBuilder();
if (builder instanceof ModuleBuilder) {
final ModuleBuilder moduleBuilder = (ModuleBuilder) builder;
if (moduleBuilder.getName() == null) {
moduleBuilder.setName(wizard.getProjectName());
}
if (moduleBuilder.getModuleFilePath() == null) {
moduleBuilder.setModuleFilePath(wizard.getModuleFilePath());
}
}
if (!builder.validate(myProject, myProject)) {
return null;
}
return wizard.getProjectBuilder();
}
return null;
}
Aggregations