diff --git a/platform/lang-impl/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java b/platform/lang-impl/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
index a64d807eb4ea..5fa9e8911a81 100644
--- a/platform/lang-impl/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
+++ b/platform/lang-impl/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
@@ -9,8 +9,10 @@ import com.intellij.ide.fileTemplates.FileTemplateUtil;
import com.intellij.ide.fileTemplates.impl.FileTemplateBase;
import com.intellij.ide.util.projectWizard.ProjectTemplateFileProcessor;
import com.intellij.ide.util.projectWizard.ProjectTemplateParameterFactory;
+import com.intellij.idea.ActionsBundle;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
+import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
@@ -98,12 +100,20 @@ public class SaveProjectAsTemplateAction extends AnAction implements DumbAware {
@Override
public void onSuccess() {
- new Notification("Project Template",
- "Template Created",
- FileUtil.getNameWithoutExtension(file.getFileName().toString()) + " was successfully created.
" +
- "It's available now in Project Wizard",
- NotificationType.INFORMATION
- ).notify(getProject());
+ AnAction newProjectAction = ActionManager.getInstance().getAction(getNewProjectActionId());
+ newProjectAction.getTemplatePresentation().setText(ActionsBundle.actionText("NewDirectoryProject"));
+ AnAction manageAction = ActionManager.getInstance().getAction("ManageProjectTemplates");
+ Notification notification = new Notification("Project Template",
+ "Template Created",
+ FileUtil.getNameWithoutExtension(file.getFileName().toString()) +
+ " was successfully created",
+ NotificationType.INFORMATION
+ );
+ notification.addAction(newProjectAction);
+ if (manageAction != null) {
+ notification.addAction(manageAction);
+ }
+ notification.notify(getProject());
}
@Override
@@ -202,6 +212,19 @@ public class SaveProjectAsTemplateAction extends AnAction implements DumbAware {
}
}
+ static String getNewProjectActionId() {
+ if (PlatformUtils.isIntelliJ()) {
+ return "NewProject";
+ }
+ else if (PlatformUtils.isPhpStorm()) {
+ return "NewDirectoryProject";
+ } else if (PlatformUtils.isWebStorm()) {
+ return "NewWebStormDirectoryProject";
+ } else {
+ throw new IllegalStateException("Provide new project action id for your IDE");
+ }
+ }
+
private static void writeFile(String path,
final String text,
Project project, String prefix, ZipOutputStream stream, boolean overwrite) throws IOException {
diff --git a/resources/src/idea/JavaActions.xml b/resources/src/idea/JavaActions.xml
index b5efe3071724..fa71af39f069 100644
--- a/resources/src/idea/JavaActions.xml
+++ b/resources/src/idea/JavaActions.xml
@@ -302,7 +302,7 @@
-
+