Merge remote-tracking branch 'origin/master'

This commit is contained in:
Konstantin Bulenkov
2013-09-30 13:33:32 +02:00
5 changed files with 47 additions and 19 deletions
@@ -22,10 +22,13 @@ public class BuilderBasedProjectType extends ProjectCategory {
return myBuilder;
}
/**
* @author Dmitry Avdeev
* Date: 04.09.13
*/
public static class Empty extends BuilderBasedProjectType {
public Empty() {
super(new EmptyProjectBuilder());
}
}
public static class Java extends BuilderBasedProjectType {
public Java() {
@@ -0,0 +1,34 @@
/*
* Copyright 2000-2013 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.projectWizard;
import com.intellij.ide.util.projectWizard.EmptyModuleBuilder;
/**
* @author Dmitry Avdeev
* Date: 27.09.13
*/
public class EmptyProjectBuilder extends EmptyModuleBuilder {
@Override
public String getPresentableName() {
return "Empty Project";
}
@Override
public String getDescription() {
return "Empty project without modules. Use it to create free-style module structure.";
}
}
@@ -33,11 +33,10 @@ public abstract class TemplateBasedProjectType extends ProjectCategory {
private final LocalArchivedTemplate myTemplate;
public TemplateBasedProjectType(String templatePath) {
ClassLoader loader = getClass().getClassLoader();
URL resource = loader.getResource(templatePath);
URL resource = getClass().getResource(templatePath);
assert resource != null : templatePath;
String name = ArchivedTemplatesFactory.getTemplateName(new File(templatePath).getName());
myTemplate = new LocalArchivedTemplate(name, resource, loader);
myTemplate = new LocalArchivedTemplate(name, resource, getClass().getClassLoader());
}
@NotNull
@@ -15,7 +15,7 @@
*/
package com.intellij.platform.templates;
import com.intellij.ide.util.projectWizard.EmptyModuleBuilder;
import com.intellij.ide.projectWizard.EmptyProjectBuilder;
import com.intellij.ide.util.projectWizard.ModuleBuilder;
import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.platform.ProjectTemplate;
@@ -60,17 +60,7 @@ public class PlainModuleTemplatesFactory extends ProjectTemplatesFactory {
if (!context.isCreatingNewProject()) {
return ProjectTemplate.EMPTY_ARRAY;
}
return new ProjectTemplate[]{new BuilderBasedTemplate(new EmptyModuleBuilder() {
@Override
public String getPresentableName() {
return "Empty Project";
}
@Override
public String getDescription() {
return "Empty project without modules. Use it to create free-style module structure.";
}
})};
return new ProjectTemplate[]{new BuilderBasedTemplate(new EmptyProjectBuilder())};
}
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
List<ProjectTemplate> templates = ContainerUtil.mapNotNull(builders, new NullableFunction<ModuleBuilder, ProjectTemplate>() {
@@ -314,6 +314,8 @@
<projectTemplatesFactory implementation="com.intellij.platform.templates.PlainModuleTemplatesFactory"/>
<projectTemplateFileProcessor implementation="com.intellij.platform.templates.SystemFileProcessor"/>
<projectWizard.projectCategory implementation="com.intellij.ide.projectWizard.BuilderBasedProjectType$Empty"/>
<applicationService serviceImplementation="com.intellij.ide.util.newProjectWizard.SelectTemplateSettings"/>
<gotoFileContributor implementation="com.intellij.ide.util.gotoByName.ProjectBaseDirNavigationContributor"/>