Search in sources :

Example 16 with ModuleWizardStep

use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.

the class AbstractProjectWizard method doCancelAction.

@Override
public void doCancelAction() {
    final ModuleWizardStep step = getCurrentStepObject();
    step.onStepLeaving();
    super.doCancelAction();
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 17 with ModuleWizardStep

use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.

the class NewProjectWizard method init.

protected void init(@NotNull ModulesProvider modulesProvider) {
    myWizardContext.setModulesProvider(modulesProvider);
    ProjectTypeStep projectTypeStep = new ProjectTypeStep(myWizardContext, this, modulesProvider);
    Disposer.register(getDisposable(), projectTypeStep);
    mySequence.addCommonStep(projectTypeStep);
    ChooseTemplateStep chooseTemplateStep = new ChooseTemplateStep(myWizardContext, projectTypeStep);
    mySequence.addCommonStep(chooseTemplateStep);
    mySequence.addCommonFinishingStep(new ProjectSettingsStep(myWizardContext), null);
    for (ModuleWizardStep step : mySequence.getAllSteps()) {
        addStep(step);
    }
    if (myWizardContext.isCreatingNewProject()) {
        projectTypeStep.loadRemoteTemplates(chooseTemplateStep);
    }
    super.init();
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 18 with ModuleWizardStep

use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.

the class AbstractProjectWizard method dispose.

@Override
protected void dispose() {
    StepSequence sequence = getSequence();
    if (sequence != null) {
        for (ModuleWizardStep step : sequence.getAllSteps()) {
            step.disposeUIResources();
        }
    }
    super.dispose();
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 19 with ModuleWizardStep

use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.

the class AddModuleWizard method navigateToStep.

/**
   * Allows to ask current wizard to move to the desired step.
   *
   * @param filter  closure that allows to indicate target step - is called with each of registered steps and is expected
   *                to return {@code true} for the step to go to
   * @return        {@code true} if current wizard is navigated to the target step; {@code false} otherwise
   */
public boolean navigateToStep(@NotNull Function<Step, Boolean> filter) {
    for (int i = 0, myStepsSize = mySteps.size(); i < myStepsSize; i++) {
        ModuleWizardStep step = mySteps.get(i);
        if (filter.fun(step) != Boolean.TRUE) {
            continue;
        }
        // Update current step.
        myCurrentStep = i;
        updateStep();
        return true;
    }
    return false;
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 20 with ModuleWizardStep

use of com.intellij.ide.util.projectWizard.ModuleWizardStep in project intellij-community by JetBrains.

the class ImportFromSourcesTestCase method importFromSources.

protected void importFromSources(File dir) {
    myRootDir = dir;
    try {
        myProject = doCreateProject(getIprFile());
        myBuilder.setBaseProjectPath(dir.getAbsolutePath());
        List<DetectedRootData> list = RootDetectionProcessor.detectRoots(dir);
        MultiMap<ProjectStructureDetector, DetectedProjectRoot> map = RootDetectionProcessor.createRootsMap(list);
        myBuilder.setupProjectStructure(map);
        for (ProjectStructureDetector detector : map.keySet()) {
            List<ModuleWizardStep> steps = detector.createWizardSteps(myBuilder, myBuilder.getProjectDescriptor(detector), EmptyIcon.ICON_16);
            try {
                for (ModuleWizardStep step : steps) {
                    if (step instanceof AbstractStepWithProgress<?>) {
                        performStep((AbstractStepWithProgress<?>) step);
                    }
                }
            } finally {
                for (ModuleWizardStep step : steps) {
                    step.disposeUIResources();
                }
            }
        }
        myBuilder.commit(myProject, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : DetectedProjectRoot(com.intellij.ide.util.projectWizard.importSources.DetectedProjectRoot) AbstractStepWithProgress(com.intellij.ide.util.projectWizard.AbstractStepWithProgress) DetectedRootData(com.intellij.ide.util.importProject.DetectedRootData) ProjectStructureDetector(com.intellij.ide.util.projectWizard.importSources.ProjectStructureDetector) ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Aggregations

ModuleWizardStep (com.intellij.ide.util.projectWizard.ModuleWizardStep)27 Project (com.intellij.openapi.project.Project)5 ArrayList (java.util.ArrayList)5 ConfigurationException (com.intellij.openapi.options.ConfigurationException)3 DelegatingProgressIndicator (com.intellij.ide.util.DelegatingProgressIndicator)2 ProjectBuilder (com.intellij.ide.util.projectWizard.ProjectBuilder)2 ProjectWizardStepFactory (com.intellij.ide.util.projectWizard.ProjectWizardStepFactory)2 SettingsStep (com.intellij.ide.util.projectWizard.SettingsStep)2 WizardContext (com.intellij.ide.util.projectWizard.WizardContext)2 ProjectStructureDetector (com.intellij.ide.util.projectWizard.importSources.ProjectStructureDetector)2 Step (com.intellij.ide.wizard.Step)2 Module (com.intellij.openapi.module.Module)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 NotNull (org.jetbrains.annotations.NotNull)2 Nullable (org.jetbrains.annotations.Nullable)2 ModuleImporter (com.android.tools.idea.gradle.project.ModuleImporter)1 WrapArchiveWizardPath (com.android.tools.idea.npw.deprecated.WrapArchiveWizardPath)1 Template (com.android.tools.idea.templates.Template)1 TemplateManager (com.android.tools.idea.templates.TemplateManager)1 ModelWizardStep (com.android.tools.idea.wizard.model.ModelWizardStep)1