use of com.intellij.ide.util.importProject.RootsDetectionStep in project intellij-community by JetBrains.
the class CreateFromSourcesMode method addSteps.
public void addSteps(WizardContext context, ModulesProvider modulesProvider, StepSequence sequence, String specific) {
final ProjectFromSourcesBuilderImpl projectBuilder = new ProjectFromSourcesBuilderImpl(context, modulesProvider);
myProjectBuilder = projectBuilder;
final Icon icon = context.getStepIcon();
if (context.isCreatingNewProject()) {
addStep(sequence, new ProjectNameStep(context, this), specific);
}
addStep(sequence, new RootsDetectionStep(projectBuilder, context, sequence, icon, "reference.dialogs.new.project.fromCode.source"), specific);
Set<String> detectorTypes = new HashSet<>();
for (ProjectStructureDetector detector : ProjectStructureDetector.EP_NAME.getExtensions()) {
detectorTypes.add(detector.getDetectorId());
for (ModuleWizardStep step : detector.createWizardSteps(projectBuilder, projectBuilder.getProjectDescriptor(detector), icon)) {
sequence.addSpecificStep(detector.getDetectorId(), step);
}
}
if (FrameworkDetectionStep.isEnabled()) {
FrameworkDetectionStep frameworkDetectionStep = new FrameworkDetectionStep(icon, projectBuilder) {
public List<ModuleDescriptor> getModuleDescriptors() {
final List<ModuleDescriptor> moduleDescriptors = new ArrayList<>();
for (ProjectDescriptor descriptor : projectBuilder.getSelectedDescriptors()) {
moduleDescriptors.addAll(descriptor.getModules());
}
return moduleDescriptors;
}
};
projectBuilder.addConfigurationUpdater(frameworkDetectionStep);
sequence.addCommonFinishingStep(frameworkDetectionStep, detectorTypes);
}
}
Aggregations