Search in sources :

Example 1 with AbstractProjectWizard

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;
}
Also used : ProjectBuilder(com.intellij.ide.util.projectWizard.ProjectBuilder) ModuleBuilder(com.intellij.ide.util.projectWizard.ModuleBuilder) NewProjectWizard(com.intellij.ide.projectWizard.NewProjectWizard) AbstractProjectWizard(com.intellij.ide.util.newProjectWizard.AbstractProjectWizard) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

NewProjectWizard (com.intellij.ide.projectWizard.NewProjectWizard)1 AbstractProjectWizard (com.intellij.ide.util.newProjectWizard.AbstractProjectWizard)1 ModuleBuilder (com.intellij.ide.util.projectWizard.ModuleBuilder)1 ProjectBuilder (com.intellij.ide.util.projectWizard.ProjectBuilder)1 Nullable (org.jetbrains.annotations.Nullable)1