diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/importSources/DefaultProjectStructureDetector.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/importSources/DefaultProjectStructureDetector.java new file mode 100644 index 000000000000..dab952f51912 --- /dev/null +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/importSources/DefaultProjectStructureDetector.java @@ -0,0 +1,48 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.ide.util.projectWizard.importSources; + +import com.intellij.ide.util.importProject.ProjectDescriptor; +import com.intellij.openapi.module.WebModuleType; +import org.jetbrains.annotations.NotNull; + +import java.io.File; +import java.util.Collection; +import java.util.List; + +/** + * @author nik + */ +public class DefaultProjectStructureDetector extends ProjectStructureDetector { + @NotNull + @Override + public DirectoryProcessingResult detectRoots(@NotNull File dir, + @NotNull File[] children, + @NotNull File base, + @NotNull List result) { + result.add(new DetectedContentRoot(dir, "Content", WebModuleType.getInstance())); + return DirectoryProcessingResult.SKIP_CHILDREN; + } + + @Override + public void setupProjectStructure(@NotNull Collection roots, + @NotNull ProjectDescriptor projectDescriptor, + @NotNull ProjectFromSourcesBuilder builder) { + if (!builder.hasRootsFromOtherDetectors(this)) { + builder.setupModulesByContentRoots(projectDescriptor, roots); + } + } +} diff --git a/resources/src/idea/RichPlatformPlugin.xml b/resources/src/idea/RichPlatformPlugin.xml index bef9a3ecd47a..d7dc396eac86 100644 --- a/resources/src/idea/RichPlatformPlugin.xml +++ b/resources/src/idea/RichPlatformPlugin.xml @@ -309,6 +309,8 @@ + +