From 578a77c93af23767cc093fb045c77aaf01be0757 Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Thu, 17 Jun 2010 16:53:13 +0400 Subject: [PATCH] show "XML Zen Coding" item at the bottom of popup --- .../generation/surroundWith/PopupActionChooser.java | 12 +++++++----- .../template/impl/SurroundWithTemplateHandler.java | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/PopupActionChooser.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/PopupActionChooser.java index 1404ba0fa919..66514b677cf2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/PopupActionChooser.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/surroundWith/PopupActionChooser.java @@ -80,15 +80,17 @@ public class PopupActionChooser { applicable.addSeparator("Live templates"); } - for (CustomLiveTemplate customTemplate : customTemplates) { - applicable.add(new WrapWithCustomTemplateAction(customTemplate, editor, file, usedMnemonicsSet)); - hasEnabledSurrounders = true; - } for (TemplateImpl template : templates) { applicable.add(new InvokeTemplateAction(template, editor, project, usedMnemonicsSet)); hasEnabledSurrounders = true; } - if (!templates.isEmpty()) { + + for (CustomLiveTemplate customTemplate : customTemplates) { + applicable.add(new WrapWithCustomTemplateAction(customTemplate, editor, file, usedMnemonicsSet)); + hasEnabledSurrounders = true; + } + + if (!templates.isEmpty() || !customTemplates.isEmpty()) { applicable.addSeparator(); applicable.add(new ConfigureTemplatesAction()); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/SurroundWithTemplateHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/SurroundWithTemplateHandler.java index 329faae575a2..c304ad30b860 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/SurroundWithTemplateHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/SurroundWithTemplateHandler.java @@ -54,13 +54,15 @@ public class SurroundWithTemplateHandler implements CodeInsightActionHandler { Set usedMnemonicsSet = new HashSet(); DefaultActionGroup group = new DefaultActionGroup(); - for (CustomLiveTemplate customTemplate : customTemplates) { - group.add(new WrapWithCustomTemplateAction(customTemplate, editor, file, usedMnemonicsSet)); - } + for (TemplateImpl template : templates) { group.add(new InvokeTemplateAction(template, editor, project, usedMnemonicsSet)); } + for (CustomLiveTemplate customTemplate : customTemplates) { + group.add(new WrapWithCustomTemplateAction(customTemplate, editor, file, usedMnemonicsSet)); + } + final ListPopup popup = JBPopupFactory.getInstance() .createActionGroupPopup(CodeInsightBundle.message("templates.select.template.chooser.title"), group, DataManager.getInstance().getDataContext(editor.getContentComponent()),