use of com.intellij.ide.util.projectWizard.ModuleBuilder in project intellij-community by JetBrains.
the class SupportForFrameworksStep method updateStep.
@Override
public void updateStep() {
ProjectBuilder builder = myContext.getProjectBuilder();
if (builder instanceof ModuleBuilder) {
myBuilder.updateFrom((ModuleBuilder) builder);
((ModuleBuilder) builder).addModuleConfigurationUpdater(myConfigurationUpdater);
}
myFrameworkSupportModel.fireWizardStepUpdated();
}
use of com.intellij.ide.util.projectWizard.ModuleBuilder 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;
}
use of com.intellij.ide.util.projectWizard.ModuleBuilder in project intellij-community by JetBrains.
the class NewModuleAction method createModuleFromWizard.
@Nullable
public Module createModuleFromWizard(Project project, @Nullable Object dataFromContext, AbstractProjectWizard wizard) {
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(project, project)) {
return null;
}
Module module;
if (builder instanceof ModuleBuilder) {
module = ((ModuleBuilder) builder).commitModule(project, null);
if (module != null) {
processCreatedModule(module, dataFromContext);
}
return module;
} else {
List<Module> modules = builder.commit(project, null, new DefaultModulesProvider(project));
if (builder.isOpenProjectSettingsAfter()) {
ModulesConfigurator.showDialog(project, null, null);
}
module = modules == null || modules.isEmpty() ? null : modules.get(0);
}
project.save();
return module;
}
Aggregations