use of com.intellij.ide.util.projectWizard.ProjectWizardStepFactory 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) };
}
Aggregations