void (File dir) { myRootDir = dir; myProject = doCreateAndOpenProject(); 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); }