IDEA-79927: "Create project from existing sources" doesn't work with HTML/JS only projects (cherry picked from commit 9f17876)

This commit is contained in:
nik
2012-03-26 09:13:19 +04:00
parent ace22ddf1c
commit 69421b9e07
2 changed files with 12 additions and 0 deletions
@@ -42,4 +42,6 @@ public interface ProjectFromSourcesBuilder {
@NotNull
WizardContext getContext();
boolean hasRootsFromOtherDetectors(ProjectStructureDetector thisDetector);
}
@@ -32,6 +32,7 @@ import com.intellij.ide.util.projectWizard.importSources.ProjectStructureDetecto
import com.intellij.openapi.application.AccessToken;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.extensions.Extensions;
import com.intellij.openapi.module.*;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
@@ -262,6 +263,15 @@ public class ProjectFromSourcesBuilderImpl extends ProjectBuilder implements Pro
myUpdaters.add(updater);
}
public boolean hasRootsFromOtherDetectors(ProjectStructureDetector thisDetector) {
for (ProjectStructureDetector projectStructureDetector : Extensions.getExtensions(ProjectStructureDetector.EP_NAME)) {
if (projectStructureDetector != thisDetector && !getProjectRoots(projectStructureDetector).isEmpty()) {
return true;
}
}
return false;
}
@NotNull
private static Module createModule(ProjectDescriptor projectDescriptor, final ModuleDescriptor descriptor,
final Map<LibraryDescriptor, Library> projectLibs, final ModifiableModuleModel moduleModel)