diff --git a/platform/lang-impl/src/com/intellij/ide/todo/TodoPanel.java b/platform/lang-impl/src/com/intellij/ide/todo/TodoPanel.java index b9f88b6631e0..afd3156fa738 100644 --- a/platform/lang-impl/src/com/intellij/ide/todo/TodoPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/todo/TodoPanel.java @@ -249,21 +249,6 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig @NotNull protected DefaultActionGroup createGroupByActionGroup() { ActionManager actionManager = ActionManager.getInstance(); - actionManager.getAction("TodoViewGroupByFlattenPackage").registerCustomShortcutSet( - new CustomShortcutSet( - KeyStroke.getKeyStroke(KeyEvent.VK_F, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK)), - myTree); - - actionManager.getAction("TodoViewGroupByShowModules").registerCustomShortcutSet( - new CustomShortcutSet( - KeyStroke.getKeyStroke(KeyEvent.VK_M, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK)), - myTree); - - actionManager.getAction("TodoViewGroupByShowPackages").registerCustomShortcutSet( - new CustomShortcutSet( - KeyStroke.getKeyStroke(KeyEvent.VK_P, SystemInfo.isMac ? InputEvent.META_MASK : InputEvent.CTRL_MASK)), - myTree); - return (DefaultActionGroup) actionManager.getAction("TodoViewGroupByGroup"); } @@ -673,6 +658,12 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig super(IdeBundle.message("action.group.by.packages"), null, PlatformIcons.GROUP_BY_PACKAGES); } + @Override + public void update(@NotNull AnActionEvent e) { + e.getPresentation().setEnabled(e.getData(TODO_PANEL_DATA_KEY) != null); + super.update(e); + } + @Override public boolean isSelected(@NotNull AnActionEvent e) { TodoPanel todoPanel = e.getData(TODO_PANEL_DATA_KEY); @@ -694,6 +685,12 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig super(IdeBundle.message("action.group.by.modules"), null, AllIcons.Actions.GroupByModule); } + @Override + public void update(@NotNull AnActionEvent e) { + e.getPresentation().setEnabled(e.getData(TODO_PANEL_DATA_KEY) != null); + super.update(e); + } + @Override public boolean isSelected(@NotNull AnActionEvent e) { TodoPanel todoPanel = e.getData(TODO_PANEL_DATA_KEY); @@ -720,7 +717,6 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig public void update(@NotNull AnActionEvent e) { super.update(e); TodoPanel todoPanel = e.getData(TODO_PANEL_DATA_KEY); - e.getPresentation().setEnabled(todoPanel != null && todoPanel.mySettings.arePackagesShown); } diff --git a/platform/platform-resources/src/META-INF/VcsExtensions.xml b/platform/platform-resources/src/META-INF/VcsExtensions.xml index 071ef002232d..ac1e05462843 100644 --- a/platform/platform-resources/src/META-INF/VcsExtensions.xml +++ b/platform/platform-resources/src/META-INF/VcsExtensions.xml @@ -88,8 +88,8 @@ - - + + diff --git a/platform/platform-resources/src/idea/LangActions.xml b/platform/platform-resources/src/idea/LangActions.xml index 6950a2cedad1..d8df47a688c4 100644 --- a/platform/platform-resources/src/idea/LangActions.xml +++ b/platform/platform-resources/src/idea/LangActions.xml @@ -1193,9 +1193,17 @@ - - - + + + + + + + + + + + diff --git a/platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java b/platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java index d3ae569c5eea..edb4731debc9 100644 --- a/platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java +++ b/platform/testFramework/extensions/src/com/intellij/keymap/KeymapsTestCase.java @@ -47,9 +47,10 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control F5", "Refresh", "Rerun"}, { "control D", "EditorDuplicate", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "FileChooser.GotoDesktop"}, { "control L", "FindNext", "Vcs.Log.FocusTextFilter"}, - { "control M", "EditorScrollToCenter", "Vcs.ShowMessageHistory"}, + { "control M", "EditorScrollToCenter", "Vcs.ShowMessageHistory", "TodoViewGroupByShowModules"}, + { "control F", "TodoViewGroupByFlattenPackage", "Find"}, { "control N", "FileChooser.NewFolder", "GotoClass", "GotoChangedFile"}, - { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "ParameterInfo"}, + { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "ParameterInfo", "TodoViewGroupByShowPackages"}, { "control R", "Replace", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"}, { "control SLASH", "CommentByLineComment", "Images.Editor.ActualSize", "UML.ActualSize"}, { "control SPACE", "CodeCompletion", "ChangesView.SetDefault"}, @@ -118,6 +119,7 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "meta 1", "ActivateProjectToolWindow", "FileChooser.GotoHome", "DuplicatesForm.SendToLeft"}, { "meta 2", "ActivateFavoritesToolWindow", "FileChooser.GotoProject", "DuplicatesForm.SendToRight"}, { "meta 3", "ActivateFindToolWindow", "FileChooser.GotoModule"}, + { "meta M", "MinimizeCurrentWindow", "TodoViewGroupByShowModules"}, { "meta N", "FileChooser.NewFolder", "Generate", "NewElement"}, { "meta O", "GotoClass", "GotoChangedFile"}, { "shift meta G", "ClassTemplateNavigation", "GoToClass", "FindPrevious"}, @@ -144,6 +146,7 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control TAB", "Switcher", "Diff.FocusOppositePane"}, { "control N", "Generate", "NewElement"}, { "shift control TAB", "Switcher", "Diff.FocusOppositePaneAndScroll"}, + { "meta M", "MinimizeCurrentWindow", "TodoViewGroupByShowModules"}, { "meta 1", "ActivateProjectToolWindow", "FileChooser.GotoHome", "DuplicatesForm.SendToLeft"}, { "meta 2", "ActivateFavoritesToolWindow", "FileChooser.GotoProject", "DuplicatesForm.SendToRight"}, { "meta 3", "ActivateFindToolWindow", "FileChooser.GotoModule"}, @@ -159,9 +162,10 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control D", "$Delete", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "FileChooser.GotoDesktop"}, { "control K", "EditorCutLineEnd", "CheckinProject"}, { "control L", "EditorScrollToCenter", "Vcs.Log.FocusTextFilter"}, - { "control M", "EditorEnter", "EditorChooseLookupItem", "NextTemplateVariable", "Console.Execute"}, + { "control M", "EditorEnter", "EditorChooseLookupItem", "NextTemplateVariable", "Console.Execute", "TodoViewGroupByShowModules"}, { "control N", "EditorDown", "FileChooser.NewFolder"}, - { "control P", "ChangesView.GroupBy.Directory", "EditorUp", "FileChooser.TogglePathShowing"}, + { "control F", "EditorRight", "TodoViewGroupByFlattenPackage"}, + { "control P", "ChangesView.GroupBy.Directory", "EditorUp", "FileChooser.TogglePathShowing","TodoViewGroupByShowPackages"}, { "control R", "org.jetbrains.plugins.ruby.rails.console.ReloadSources", "FindPrevious"}, { "control SLASH", "$Undo", "Images.Editor.ActualSize", "UML.ActualSize"}, { "control SPACE", "EditorToggleStickySelection", "ChangesView.SetDefault"}, @@ -187,7 +191,7 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control F1", "ExternalJavaDoc", "ShowErrorDescription"}, { "control F10", "Android.HotswapChanges", "RunToCursor", "UpdateRunningApplication"}, { "control N", "FileChooser.NewFolder", "Generate", }, - { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print"}, + { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print", "TodoViewGroupByShowPackages"}, { "control alt F", "ReformatCode", "IntroduceField", "ShowFilterPopup"}, { "shift F12", "RestoreDefaultLayout", "FindUsagesInFile"}, { "shift F2", "GotoPreviousError", "GotoDeclaration"}, @@ -226,9 +230,10 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control D", "EditorDeleteLine", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "FileChooser.GotoDesktop"}, { "control L", "Vcs.Log.FocusTextFilter", "GotoLine"}, { "control N", "ShowPopupMenu", "FileChooser.NewFolder"}, - { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print"}, + { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print", "TodoViewGroupByShowPackages"}, { "control R", "RunToCursor", "org.jetbrains.plugins.ruby.rails.console.ReloadSources"}, { "control U", "EvaluateExpression", "CommanderSwapPanels"}, + { "control F", "Replace", "TodoViewGroupByFlattenPackage"}, { "control PAGE_DOWN", "Diff.NextChange", "NextTab"}, { "control PAGE_UP", "Diff.PrevChange", "PreviousTab"}, { "control F6", "Diff.NextChange", "NextTab"}, @@ -264,7 +269,7 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "control 3", "ActivateProjectToolWindow", "FileChooser.GotoModule"}, { "control BACK_SPACE", "EditorDeleteToWordStart", "ToggleDockMode"}, { "control DIVIDE", "CollapseRegionRecursively", "Images.Editor.ActualSize", "UML.ActualSize"}, - { "control M", "Vcs.ShowMessageHistory", "Move"}, + { "control M", "Vcs.ShowMessageHistory", "Move", "TodoViewGroupByShowModules"}, { "control N", "NewElement", "FileChooser.NewFolder"}, { "control R", "RenameElement", "org.jetbrains.plugins.ruby.rails.console.ReloadSources", "Git.Reword.Commit", "ShelvedChanges.Rename", "ChangesView.Rename"}, { "control U", SECOND_STROKE, "CommanderSwapPanels"}, @@ -292,8 +297,8 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { "SearchEverywhere.CompleteCommand", "SearchEverywhere.NextTab"}, { "control F6", "PreviousEditorTab", "PreviousTab", }, { "control L", "Vcs.Log.FocusTextFilter", "EditorSelectLine"}, - { "control M", "Vcs.ShowMessageHistory", "OverrideMethods", }, - { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "FindInPath"}, + { "control M", "Vcs.ShowMessageHistory", "OverrideMethods", "TodoViewGroupByShowModules"}, + { "control P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "FindInPath", "TodoViewGroupByShowPackages"}, { "shift control A", "SaveAll", "GotoAction"}, { "shift control E", "RecentChangedFiles", "ExtractMethod"}, { "shift control ENTER", "FindUsages", "Console.Jpa.GenerateSql"}, @@ -313,7 +318,7 @@ public abstract class KeymapsTestCase extends KeymapsTestCaseBase { { "meta 3", "FileChooser.GotoModule", "GotoAction"}, { "meta D", "EditorDeleteLine", "Diff.ShowDiff", "CompareTwoFiles", "SendEOF", "FileChooser.GotoDesktop"}, { "meta I", "DatabaseView.PropertiesAction", "AutoIndentLines"}, - { "meta P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print"}, + { "meta P", "ChangesView.GroupBy.Directory", "FileChooser.TogglePathShowing", "Print", "TodoViewGroupByShowPackages"}, { "meta R", "org.jetbrains.plugins.ruby.rails.console.ReloadSources", "RunToCursor"}, { "meta U", "CommanderSwapPanels", "EvaluateExpression"}, { "meta W", "CloseContent", "CloseActiveTab"},