Search in sources :

Example 1 with ModuleWizardStep

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

the class MvcProjectStructureDetector method createWizardSteps.

@Override
public List<ModuleWizardStep> createWizardSteps(ProjectFromSourcesBuilder builder, ProjectDescriptor projectDescriptor, Icon stepIcon) {
    final ModuleWizardStep groovySdkStep = new GroovySdkForProjectFromSourcesStep(this, builder, projectDescriptor, myFramework);
    final ModuleWizardStep javaSdkStep = ProjectWizardStepFactory.getInstance().createProjectJdkStep(builder.getContext());
    return Arrays.asList(javaSdkStep, groovySdkStep);
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 2 with ModuleWizardStep

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

the class MavenProjectImportProvider method createSteps.

public ModuleWizardStep[] createSteps(final WizardContext wizardContext) {
    final ProjectWizardStepFactory stepFactory = ProjectWizardStepFactory.getInstance();
    return new ModuleWizardStep[] { new MavenProjectImportStep(wizardContext), new SelectProfilesStep(wizardContext), new SelectImportedProjectsStep<MavenProject>(wizardContext) {

        @Override
        protected String getElementText(final MavenProject project) {
            final StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(project.getMavenId());
            VirtualFile root = ((MavenProjectBuilder) getBuilder()).getRootDirectory();
            if (root != null) {
                final String relPath = VfsUtilCore.getRelativePath(project.getDirectoryFile(), root, File.separatorChar);
                if (StringUtil.isNotEmpty(relPath)) {
                    stringBuilder.append(" [").append(relPath).append("]");
                }
            }
            if (!isElementEnabled(project)) {
                stringBuilder.append(" (project is ignored. See ").append(CommonBundle.settingsActionPath()).append(" | Maven | Ignored Files)");
            }
            return stringBuilder.toString();
        }

        @Override
        protected boolean isElementEnabled(MavenProject mavenProject) {
            Project project = wizardContext.getProject();
            if (project == null)
                return true;
            return !MavenProjectsManager.getInstance(project).isIgnored(mavenProject);
        }

        @Override
        public void updateDataModel() {
            super.updateDataModel();
            getWizardContext().setProjectName(((MavenProjectBuilder) getBuilder()).getSuggestedProjectName());
        }

        @Override
        public String getHelpId() {
            return "reference.dialogs.new.project.import.maven.page3";
        }
    }, stepFactory.createProjectJdkStep(wizardContext), stepFactory.createNameAndLocationStep(wizardContext) };
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SelectImportedProjectsStep(com.intellij.projectImport.SelectImportedProjectsStep) MavenProject(org.jetbrains.idea.maven.project.MavenProject) Project(com.intellij.openapi.project.Project) ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep) MavenProject(org.jetbrains.idea.maven.project.MavenProject) ProjectWizardStepFactory(com.intellij.ide.util.projectWizard.ProjectWizardStepFactory)

Example 3 with ModuleWizardStep

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

the class WebModuleBuilder method modifySettingsStep.

@Nullable
@Override
public ModuleWizardStep modifySettingsStep(@NotNull SettingsStep settingsStep) {
    if (myTemplate == null) {
        return super.modifySettingsStep(settingsStep);
    }
    final WebProjectGenerator.GeneratorPeer peer = myTemplate.getPeer();
    peer.buildUI(settingsStep);
    return new ModuleWizardStep() {

        @Override
        public JComponent getComponent() {
            return null;
        }

        @Override
        public void updateDataModel() {
        }

        @Override
        public boolean validate() throws ConfigurationException {
            ValidationInfo info = peer.validate();
            if (info != null)
                throw new ConfigurationException(info.message);
            return true;
        }
    };
}
Also used : ValidationInfo(com.intellij.openapi.ui.ValidationInfo) WebProjectGenerator(com.intellij.platform.WebProjectGenerator) ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep) ConfigurationException(com.intellij.openapi.options.ConfigurationException) Nullable(org.jetbrains.annotations.Nullable)

Example 4 with ModuleWizardStep

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

the class AbstractProjectWizard method getPreviousStep.

@Override
protected final int getPreviousStep(final int step) {
    ModuleWizardStep previousStep = null;
    final StepSequence stepSequence = getSequence();
    if (stepSequence != null) {
        final ModuleWizardStep current = mySteps.get(step);
        if (isNotFirstSubStepInStep(current)) {
            return step;
        }
        previousStep = stepSequence.getPreviousStep(current);
        while (previousStep != null && !previousStep.isStepVisible()) {
            previousStep = stepSequence.getPreviousStep(previousStep);
        }
    }
    return previousStep == null ? 0 : mySteps.indexOf(previousStep);
}
Also used : ModuleWizardStep(com.intellij.ide.util.projectWizard.ModuleWizardStep)

Example 5 with ModuleWizardStep

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

the class AbstractProjectWizard method doNextAction.

@Override
public void doNextAction() {
    if (myDelegate != null) {
        myDelegate.doNextAction();
        return;
    }
    final ModuleWizardStep step = getCurrentStepObject();
    if (!commitStepData(step)) {
        return;
    }
    step.onStepLeaving();
    super.doNextAction();
}
Also used : 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