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