diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/MacrosGroup.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/MacrosGroup.java index 73c86574fe58..fe11f19a0967 100644 --- a/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/MacrosGroup.java +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/MacrosGroup.java @@ -21,6 +21,7 @@ import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.ex.ActionManagerEx; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; @@ -33,16 +34,18 @@ import java.util.ArrayList; * To change this template use Options | File Templates. */ public class MacrosGroup extends ActionGroup { + @NotNull public AnAction[] getChildren(@Nullable AnActionEvent e) { ArrayList actions = new ArrayList(); final ActionManagerEx actionManager = ((ActionManagerEx) ActionManager.getInstance()); String[] ids = actionManager.getActionIds(ActionMacro.MACRO_ACTION_PREFIX); - for (int i = 0; i < ids.length; i++) { - String id = ids[i]; + for (String id : ids) { actions.add(actionManager.getAction(id)); } return actions.toArray(new AnAction[actions.size()]); } + + } diff --git a/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/PlaySavedMacros.java b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/PlaySavedMacros.java new file mode 100644 index 000000000000..9e4057e658cd --- /dev/null +++ b/platform/platform-impl/src/com/intellij/ide/actionMacro/actions/PlaySavedMacros.java @@ -0,0 +1,18 @@ +package com.intellij.ide.actionMacro.actions; + +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.ui.popup.JBPopupFactory; + +/** + * User: Evgeny.Zakrevsky + * Date: 8/14/12 + */ +public class PlaySavedMacros extends AnAction { + @Override + public void actionPerformed(final AnActionEvent e) { + JBPopupFactory.getInstance() + .createActionGroupPopup("Play Saved Macros", new MacrosGroup(), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false) + .showCenteredInCurrentWindow(e.getProject()); + } +} diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index a6e457b6e768..3c1213959fac 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -687,13 +687,16 @@ action.GenerateJavadoc.text=Generate Java_Doc... action.GenerateJavadoc.description=Run the JavaDoc tool group.Macros.text=_Macros group.Macros.description=View, Change, Record, Play Macros -group.StanardMacroActions.text=Standard Macro Actions +group.StandardMacroActions.text=Standard Macro Actions action.PlaybackLastMacro.text=Pla_y Back Last Macro action.PlaybackLastMacro.description=Play Back last used macro action.StartStopMacroRecording.text=Start/Stop Macro _Recording action.StartStopMacroRecording.description=Start/Stop recording of a new macro action.EditMacros.text=_Edit Macros action.EditMacros.description=Configure existing macros +action.PlaySavedMacrosAction.text=Play Saved Macros... +action.PlaySavedMacrosAction.description=Play Saved Macros +group.MacrosGroup.text=Macro Actions action.ValidateXml.text=_Validate action.ValidateXml.description=Validate the current XML file action.GenerateDTD.text=Generate DTD from _XML File @@ -1192,7 +1195,6 @@ group.EditorPopupMenu.Run.text=Compile/Run Actions group.ProjectViewCompileGroup.text=Compile/Debug Actions group.ProjectViewAnalysisGroup.text=Analysis Actions action.PerformanceReport.text=Submit Performance Report -group.MacrosGroup.text=Macro Actions group.PairFileActions.text=Actions on Pairs of Files group.RefactoringMenu1.text=Refactoring Actions (1) group.RefactoringMenu2.text=Refactoring Actions (2) @@ -1244,8 +1246,6 @@ group.AnalyzeJavaMenu.text=Analyze Java Menu group.AnalyzeJavaMenu.description=Analyze Java Menu action.InvalidateCaches.text=Invalidate Caches... action.InvalidateCaches.description=Force rebuild of all caches and indices on next startup -group.PlaySavedMacroActions.text=Play Saved Macros -group.PlaySavedMacroActions.description=Play Saved Macros group.ToolsBasicGroup.text=Tools Basic Group group.ToolsBasicGroup.description=Tools Basic Group group.ToolbarNewElement.text=Toolbar New Element Group diff --git a/platform/platform-resources/src/idea/PlatformActions.xml b/platform/platform-resources/src/idea/PlatformActions.xml index 8f1ae1602124..adb792aaea16 100644 --- a/platform/platform-resources/src/idea/PlatformActions.xml +++ b/platform/platform-resources/src/idea/PlatformActions.xml @@ -203,13 +203,14 @@ - + + - +