From e38e1fba128ecf666679df3f2eab8d3fefef2268 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Fri, 1 Feb 2013 15:02:54 +0400 Subject: [PATCH] project templates: required plugins for groups --- .../util/projectWizard/JavaSettingsStep.java | 58 ++++++++++--------- .../platform/templates/IU_template_groups.xml | 2 + .../platform/templates/IU_template_groups.xsd | 12 ++-- .../templates/RemoteTemplatesFactory.java | 41 +++++++------ .../templates/TemplateModuleBuilder.java | 7 +++ 5 files changed, 71 insertions(+), 49 deletions(-) diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/JavaSettingsStep.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/JavaSettingsStep.java index 786f83292c21..5f09d45bd01b 100644 --- a/java/idea-ui/src/com/intellij/ide/util/projectWizard/JavaSettingsStep.java +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/JavaSettingsStep.java @@ -52,36 +52,40 @@ public class JavaSettingsStep extends SdkSettingsStep { myModuleBuilder = moduleBuilder; if (moduleBuilder instanceof JavaModuleBuilder) { - Project project = settingsStep.getContext().getProject(); - ComponentWithBrowseButton.BrowseFolderActionListener listener = - new ComponentWithBrowseButton.BrowseFolderActionListener( - IdeBundle.message("prompt.select.source.directory"), null, mySourcePath, project, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, - TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) { - @Override - protected void onFileChoosen(VirtualFile chosenFile) { - String contentEntryPath = myModuleBuilder.getContentEntryPath(); - String path = chosenFile.getPath(); - if (contentEntryPath != null) { - - int i = StringUtil.commonPrefixLength(contentEntryPath, path); - mySourcePath.setText(path.substring(i)); - } - else { - mySourcePath.setText(path); - } - } - }; - mySourcePath.addBrowseFolderListener(project, listener); - myCreateSourceRoot.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - mySourcePath.setEnabled(myCreateSourceRoot.isSelected()); - } - }); - settingsStep.addExpertPanel(myPanel); + addSourcePath(settingsStep); } } + private void addSourcePath(SettingsStep settingsStep) { + Project project = settingsStep.getContext().getProject(); + ComponentWithBrowseButton.BrowseFolderActionListener listener = + new ComponentWithBrowseButton.BrowseFolderActionListener( + IdeBundle.message("prompt.select.source.directory"), null, mySourcePath, project, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR, + TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) { + @Override + protected void onFileChoosen(VirtualFile chosenFile) { + String contentEntryPath = myModuleBuilder.getContentEntryPath(); + String path = chosenFile.getPath(); + if (contentEntryPath != null) { + + int i = StringUtil.commonPrefixLength(contentEntryPath, path); + mySourcePath.setText(path.substring(i)); + } + else { + mySourcePath.setText(path); + } + } + }; + mySourcePath.addBrowseFolderListener(project, listener); + myCreateSourceRoot.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + mySourcePath.setEnabled(myCreateSourceRoot.isSelected()); + } + }); + settingsStep.addExpertPanel(myPanel); + } + @Override public void updateDataModel() { super.updateDataModel(); diff --git a/java/idea-ui/src/com/intellij/platform/templates/IU_template_groups.xml b/java/idea-ui/src/com/intellij/platform/templates/IU_template_groups.xml index 52446026f3b6..d3a955acb42a 100644 --- a/java/idea-ui/src/com/intellij/platform/templates/IU_template_groups.xml +++ b/java/idea-ui/src/com/intellij/platform/templates/IU_template_groups.xml @@ -2,6 +2,8 @@ Spring Spring + com.intellij.spring + org.jetbrains.idea.maven