summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java')
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java
index 9a7a724e2d5d..1c0b72a5a454 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java
@@ -19,6 +19,7 @@ package com.intellij.codeInsight.template.impl;
import com.intellij.application.options.ExportSchemeAction;
import com.intellij.application.options.SchemesToImportPopup;
import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.icons.AllIcons;
import com.intellij.ide.DataManager;
import com.intellij.ide.dnd.*;
import com.intellij.ide.dnd.aware.DnDAwareTree;
@@ -690,6 +691,17 @@ public class TemplateListPanel extends JPanel implements Disposable {
public void updateButton(AnActionEvent e) {
e.getPresentation().setEnabled(getTemplate(getSingleSelectedIndex()) != null);
}
+ }).addExtraAction(new AnActionButton("Restore deleted defaults", AllIcons.General.TodoDefault) {
+ @Override
+ public void actionPerformed(@NotNull AnActionEvent e) {
+ TemplateSettings.getInstance().reset();
+ reset();
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return super.isEnabled() && !TemplateSettings.getInstance().getDeletedTemplates().isEmpty();
+ }
});
if (getSchemesManager().isExportAvailable()) {
decorator.addExtraAction(new AnActionButton("Share...", PlatformIcons.EXPORT_ICON) {