From 471a5cd0d035019644cb3f2a131e35ed1477d024 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 2 Oct 2014 13:22:15 +0400 Subject: [PATCH] IDEA-130131 Emacs Tab conflict with tab in live template --- .../impl/ActionShortcutRestrictions.java | 16 +++--- .../impl/ActionShortcutRestrictionsImpl.java | 37 ++++++++++++++ .../keymap/impl/ShortcutRestrictions.java | 10 +++- .../openapi/keymap/impl/ui/ActionsTree.java | 12 ++--- .../keymap/impl/ui/ActionsTreeUtil.java | 32 +++++++++--- .../openapi/keymap/impl/ui/KeymapPanel.java | 2 +- .../src/META-INF/PlatformExtensions.xml | 2 + .../src/idea/Keymap_Default.xml | 3 ++ .../src/idea/Keymap_Emacs.xml | 3 -- .../src/idea/PlatformLangActionManager.xml | 2 +- .../keymap/impl/ui/ActionsTreeTest.java | 51 ++++++++++++++++--- .../openapi/keymap/KeymapsTestCase.java | 10 ++-- resources/src/idea/RichPlatformActions.xml | 2 +- 13 files changed, 139 insertions(+), 43 deletions(-) create mode 100644 platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictionsImpl.java diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictions.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictions.java index 42746e0b6568..35ef2ecb5162 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictions.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictions.java @@ -15,16 +15,14 @@ */ package com.intellij.openapi.keymap.impl; -import com.intellij.openapi.actionSystem.IdeActions; +import com.intellij.openapi.components.ServiceManager; import org.jetbrains.annotations.NotNull; -public class ActionShortcutRestrictions { - @NotNull - public static ShortcutRestrictions getForActionId(String actionId) { - if (IdeActions.ACTION_EDITOR_ADD_OR_REMOVE_CARET.equals(actionId) || - IdeActions.ACTION_EDITOR_CREATE_RECTANGULAR_SELECTION.equals(actionId)) { - return new ShortcutRestrictions(true, false, false, false); - } - return ShortcutRestrictions.NO_RESTRICTIONS; +public abstract class ActionShortcutRestrictions { + public static ActionShortcutRestrictions getInstance() { + return ServiceManager.getService(ActionShortcutRestrictions.class); } + + @NotNull + public abstract ShortcutRestrictions getForActionId(String actionId); } diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictionsImpl.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictionsImpl.java new file mode 100644 index 000000000000..cdb03f920abf --- /dev/null +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ActionShortcutRestrictionsImpl.java @@ -0,0 +1,37 @@ +/* + * Copyright 2000-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.intellij.openapi.keymap.impl; + +import com.intellij.openapi.actionSystem.IdeActions; +import org.jetbrains.annotations.NotNull; + +public class ActionShortcutRestrictionsImpl extends ActionShortcutRestrictions { + private static final ShortcutRestrictions MOUSE_SINGLE_CLICK_ONLY = new ShortcutRestrictions(true, true, false, false, false); + private static final ShortcutRestrictions FIXED_SHORTCUT = new ShortcutRestrictions(false, false, false, false, false); + + @Override + @NotNull + public ShortcutRestrictions getForActionId(String actionId) { + if (IdeActions.ACTION_EDITOR_ADD_OR_REMOVE_CARET.equals(actionId) || + IdeActions.ACTION_EDITOR_CREATE_RECTANGULAR_SELECTION.equals(actionId)) { + return MOUSE_SINGLE_CLICK_ONLY; + } + if (IdeActions.ACTION_EXPAND_LIVE_TEMPLATE_BY_TAB.equals(actionId)) { + return FIXED_SHORTCUT; + } + return ShortcutRestrictions.NO_RESTRICTIONS; + } +} diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java index 1729dc94b93c..9dce136cf487 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ShortcutRestrictions.java @@ -16,14 +16,20 @@ package com.intellij.openapi.keymap.impl; public class ShortcutRestrictions { - public static final ShortcutRestrictions NO_RESTRICTIONS = new ShortcutRestrictions(true, true, true, true); + public static final ShortcutRestrictions NO_RESTRICTIONS = new ShortcutRestrictions(true, true, true, true, true); + public final boolean allowChanging; public final boolean allowMouseShortcut; public final boolean allowMouseDoubleClick; public final boolean allowKeyboardShortcut; public final boolean allowAbbreviation; - public ShortcutRestrictions(boolean allowMouseShortcut, boolean allowMouseDoubleClick, boolean allowKeyboardShortcut, boolean allowAbbreviation) { + public ShortcutRestrictions(boolean allowChanging, + boolean allowMouseShortcut, + boolean allowMouseDoubleClick, + boolean allowKeyboardShortcut, + boolean allowAbbreviation) { + this.allowChanging = allowChanging; this.allowMouseShortcut = allowMouseShortcut; this.allowMouseDoubleClick = allowMouseDoubleClick; this.allowKeyboardShortcut = allowKeyboardShortcut; diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java index 44ec15003de9..9dae89cdec23 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -198,13 +198,11 @@ public class ActionsTree { ActionManager actionManager = ActionManager.getInstance(); Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myComponent)); - Group mainGroup = ActionsTreeUtil.createMainGroup(project, myKeymap, allQuickLists, filter, true, filter != null && filter.length() > 0 ? - ActionsTreeUtil.isActionFiltered(filter, true) : - (shortcut != null ? ActionsTreeUtil.isActionFiltered(actionManager, myKeymap, shortcut) : null)); + Group mainGroup = ActionsTreeUtil.createMainGroup(project, myKeymap, allQuickLists, filter, true, + ActionsTreeUtil.isActionFiltered(actionManager, myKeymap, shortcut, filter, true)); if ((filter != null && filter.length() > 0 || shortcut != null) && mainGroup.initIds().isEmpty()){ - mainGroup = ActionsTreeUtil.createMainGroup(project, myKeymap, allQuickLists, filter, false, filter != null && filter.length() > 0 ? - ActionsTreeUtil.isActionFiltered(filter, false) : - ActionsTreeUtil.isActionFiltered(actionManager, myKeymap, shortcut)); + mainGroup = ActionsTreeUtil.createMainGroup(project, myKeymap, allQuickLists, filter, false, + ActionsTreeUtil.isActionFiltered(actionManager, myKeymap, shortcut, filter, false)); } myRoot = ActionsTreeUtil.createNode(mainGroup); myMainGroup = mainGroup; diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTreeUtil.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTreeUtil.java index 17a208f08eb6..744a8d443f9c 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTreeUtil.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTreeUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 JetBrains s.r.o. + * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import com.intellij.openapi.keymap.KeyMapBundle; import com.intellij.openapi.keymap.Keymap; import com.intellij.openapi.keymap.KeymapExtension; import com.intellij.openapi.keymap.ex.KeymapManagerEx; +import com.intellij.openapi.keymap.impl.ActionShortcutRestrictions; import com.intellij.openapi.keymap.impl.KeymapImpl; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; @@ -138,19 +139,25 @@ public class ActionsTreeUtil { @Nullable private static Condition wrapFilter(@Nullable final Condition filter, final Keymap keymap, final ActionManager actionManager) { - if (Registry.is("keymap.show.alias.actions")) return filter; - + final ActionShortcutRestrictions shortcutRestrictions = ActionShortcutRestrictions.getInstance(); return new Condition() { @Override public boolean value(final AnAction action) { if (action == null) return false; final String id = action instanceof ActionStub ? ((ActionStub)action).getId() : actionManager.getId(action); if (id != null) { - String binding = getActionBinding(keymap, id); - boolean bound = binding != null - && actionManager.getAction(binding) != null // do not hide bound action, that miss the 'bound-with' - && !hasAssociatedShortcutsInHierarchy(id, keymap); // do not hide bound actions when they are redefined - return filter == null ? !bound : !bound && filter.value(action); + if (!Registry.is("keymap.show.alias.actions")) { + String binding = getActionBinding(keymap, id); + boolean bound = binding != null + && actionManager.getAction(binding) != null // do not hide bound action, that miss the 'bound-with' + && !hasAssociatedShortcutsInHierarchy(id, keymap); // do not hide bound actions when they are redefined + if (bound) { + return false; + } + } + if (!shortcutRestrictions.getForActionId(id).allowChanging) { + return false; + } } return filter == null || filter.value(action); @@ -538,4 +545,13 @@ public class ActionsTreeUtil { } }; } + + public static Condition isActionFiltered(final ActionManager actionManager, + final Keymap keymap, + final KeyboardShortcut shortcut, + final String filter, + final boolean force) { + return filter != null && filter.length() > 0 ? isActionFiltered(filter, force) : + shortcut != null ? isActionFiltered(actionManager, keymap, shortcut) : null; + } } diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java index c16970533e6e..6ac078aa58c2 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java @@ -973,7 +973,7 @@ public class KeymapPanel extends JPanel implements SearchableConfigurable, Confi final Shortcut[] shortcuts = getCurrentShortcuts(actionId); final Set abbreviations = AbbreviationManager.getInstance().getAbbreviations(actionId); - final ShortcutRestrictions restrictions = ActionShortcutRestrictions.getForActionId(actionId); + final ShortcutRestrictions restrictions = ActionShortcutRestrictions.getInstance().getForActionId(actionId); if (restrictions.allowKeyboardShortcut) { group.add(new DumbAwareAction("Add Keyboard Shortcut") { diff --git a/platform/platform-resources/src/META-INF/PlatformExtensions.xml b/platform/platform-resources/src/META-INF/PlatformExtensions.xml index 53a6962b053c..a63676d18905 100644 --- a/platform/platform-resources/src/META-INF/PlatformExtensions.xml +++ b/platform/platform-resources/src/META-INF/PlatformExtensions.xml @@ -83,6 +83,8 @@ serviceImplementation="com.intellij.ui.SystemNotificationsImpl"/> + + + + diff --git a/platform/platform-resources/src/idea/Keymap_Emacs.xml b/platform/platform-resources/src/idea/Keymap_Emacs.xml index 66313548bcb1..b4b5ade6c3bb 100644 --- a/platform/platform-resources/src/idea/Keymap_Emacs.xml +++ b/platform/platform-resources/src/idea/Keymap_Emacs.xml @@ -234,9 +234,6 @@ - - - diff --git a/platform/platform-resources/src/idea/PlatformLangActionManager.xml b/platform/platform-resources/src/idea/PlatformLangActionManager.xml index e715373903c8..47fe6429bbeb 100644 --- a/platform/platform-resources/src/idea/PlatformLangActionManager.xml +++ b/platform/platform-resources/src/idea/PlatformLangActionManager.xml @@ -7,7 +7,7 @@ - + diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java index b824c8a3d01c..ebc0b7268025 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/keymap/impl/ui/ActionsTreeTest.java @@ -17,13 +17,18 @@ package com.intellij.openapi.keymap.impl.ui; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.QuickList; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.keymap.KeymapManager; import com.intellij.openapi.keymap.ex.KeymapManagerEx; +import com.intellij.openapi.keymap.impl.ActionShortcutRestrictions; import com.intellij.openapi.keymap.impl.KeymapImpl; import com.intellij.openapi.keymap.impl.KeymapManagerImpl; +import com.intellij.openapi.keymap.impl.ShortcutRestrictions; import com.intellij.testFramework.LightPlatformCodeInsightTestCase; import com.intellij.testFramework.PlatformTestCase; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.picocontainer.MutablePicoContainer; import javax.swing.*; import java.util.ArrayList; @@ -40,7 +45,9 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { private static final String ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED = "DummyWithUseShortcutOfExistentActionRedefined"; private static final String ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT = "DummyWithUseShortcutOfExistentActionRedefinedInParent"; private static final String ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION = "DummyWithUseShortcutOfNonExistentAction"; - + + private static final String ACTION_WITH_FIXED_SHORTCUTS = "DummyActionWithFixedShortcuts"; + private static final String ACTION_EDITOR_DELETE_WITH_SHORTCUT = "EditorDelete"; private static final String ACTION_EDITOR_CUT_WITHOUT_SHORTCUT = "EditorCut"; @@ -52,8 +59,12 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { private AnAction myActionWithUseShortcutOfExistentRedefined; private AnAction myActionWithUseShortcutOfExistentRedefinedInParent; private AnAction myActionWithUseShortcutOfNonExistent; - + private AnAction myActionWithFixedShortcuts; + private ActionsTree myActionsTree; + + private ActionShortcutRestrictions mySavedRestrictions; + static { PlatformTestCase.initPlatformLangPrefix(); } @@ -69,6 +80,7 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { myActionWithUseShortcutOfExistentRedefined = new MyAction("text", "description"); myActionWithUseShortcutOfExistentRedefinedInParent = new MyAction("text", "description"); myActionWithUseShortcutOfNonExistent = new MyAction("text", "description"); + myActionWithFixedShortcuts = new MyAction("text", "description"); ActionManager actionManager = ActionManager.getInstance(); actionManager.registerAction(ACTION_WITHOUT_TEXT_AND_DESCRIPTION, myActionWithoutTextAndDescription); @@ -79,12 +91,23 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { actionManager.registerAction(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED, myActionWithUseShortcutOfExistentRedefined); actionManager.registerAction(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT, myActionWithUseShortcutOfExistentRedefinedInParent); actionManager.registerAction(ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION, myActionWithUseShortcutOfNonExistent); + actionManager.registerAction(ACTION_WITH_FIXED_SHORTCUTS, myActionWithFixedShortcuts); KeymapManagerEx.getInstanceEx().bindShortcuts(EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION); KeymapManagerEx.getInstanceEx().bindShortcuts(EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED); KeymapManagerEx.getInstanceEx().bindShortcuts(EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT); KeymapManagerEx.getInstanceEx().bindShortcuts(NON_EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION); + mySavedRestrictions = ActionShortcutRestrictions.getInstance(); + setRestrictions(new ActionShortcutRestrictions(){ + @NotNull + @Override + public ShortcutRestrictions getForActionId(String actionId) { + return ACTION_WITH_FIXED_SHORTCUTS.equals(actionId) + ? new ShortcutRestrictions(false, false, false, false, false) : ShortcutRestrictions.NO_RESTRICTIONS; + } + }); + assertEquals("$Delete", KeymapManagerEx.getInstanceEx().getActionBinding(ACTION_EDITOR_DELETE_WITH_SHORTCUT)); assertEquals("$Cut", KeymapManagerEx.getInstanceEx().getActionBinding(ACTION_EDITOR_CUT_WITHOUT_SHORTCUT)); assertNotNull(actionManager.getAction(ACTION_EDITOR_DELETE_WITH_SHORTCUT)); @@ -98,7 +121,8 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { myActionWithUseShortcutOfExistent, myActionWithUseShortcutOfExistentRedefined, myActionWithUseShortcutOfExistentRedefinedInParent, - myActionWithUseShortcutOfNonExistent); + myActionWithUseShortcutOfNonExistent, + myActionWithFixedShortcuts); // populate action tree myActionsTree = new ActionsTree(); @@ -118,6 +142,10 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { @Override protected void tearDown() throws Exception { try { + if (mySavedRestrictions != null) { + setRestrictions(mySavedRestrictions); + } + ActionManager actionManager = ActionManager.getInstance(); DefaultActionGroup group = (DefaultActionGroup)actionManager.getAction(IdeActions.GROUP_EDITOR); group.remove(myActionWithoutTextAndDescription); @@ -128,6 +156,7 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { group.remove(myActionWithUseShortcutOfExistentRedefined); group.remove(myActionWithUseShortcutOfExistentRedefinedInParent); group.remove(myActionWithUseShortcutOfNonExistent); + group.remove(myActionWithFixedShortcuts); actionManager.unregisterAction(ACTION_WITHOUT_TEXT_AND_DESCRIPTION); actionManager.unregisterAction(ACTION_WITH_TEXT_ONLY); actionManager.unregisterAction(ACTION_WITH_TEXT_AND_DESCRIPTION); @@ -136,6 +165,7 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { actionManager.unregisterAction(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED); actionManager.unregisterAction(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED_IN_PARENT); actionManager.unregisterAction(ACTION_WITH_USE_SHORTCUT_OF_NON_EXISTENT_ACTION); + actionManager.unregisterAction(ACTION_WITH_FIXED_SHORTCUTS); ((KeymapManagerImpl)KeymapManager.getInstance()).unbindShortcuts(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION); ((KeymapManagerImpl)KeymapManager.getInstance()).unbindShortcuts(ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION_REDEFINED); @@ -147,6 +177,13 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { } } + private static void setRestrictions(ActionShortcutRestrictions restrictions) { + MutablePicoContainer picoContainer = (MutablePicoContainer) ApplicationManager.getApplication().getPicoContainer(); + String restrictionsKey = ActionShortcutRestrictions.class.getName(); + picoContainer.unregisterComponent(restrictionsKey); + picoContainer.registerComponentInstance(restrictionsKey, restrictions); + } + public void testVariousActionsArePresent() { doTest(null, Arrays.asList( @@ -161,7 +198,8 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { Arrays.asList( NON_EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION, - ACTION_EDITOR_CUT_WITHOUT_SHORTCUT // this one is not shown since bound to $cut + ACTION_EDITOR_CUT_WITHOUT_SHORTCUT, // this one is not shown since bound to $cut + ACTION_WITH_FIXED_SHORTCUTS ) ); } @@ -181,7 +219,8 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { NON_EXISTENT_ACTION, ACTION_WITH_USE_SHORTCUT_OF_EXISTENT_ACTION, ACTION_EDITOR_DELETE_WITH_SHORTCUT, - ACTION_EDITOR_CUT_WITHOUT_SHORTCUT + ACTION_EDITOR_CUT_WITHOUT_SHORTCUT, + ACTION_WITH_FIXED_SHORTCUTS ) ); } @@ -209,7 +248,7 @@ public class ActionsTreeTest extends LightPlatformCodeInsightTestCase { } @Override - public void actionPerformed(AnActionEvent e) { + public void actionPerformed(@NotNull AnActionEvent e) { } } } diff --git a/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java b/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java index e722fcd1a72e..5e9d4da333c4 100644 --- a/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java +++ b/platform/testFramework/testSrc/com/intellij/openapi/keymap/KeymapsTestCase.java @@ -78,7 +78,7 @@ public abstract class KeymapsTestCase extends PlatformTestCase { { "F7", "NextDiff", "StepInto"}, { "INSERT", "EditorToggleInsertState", "UsageView.Include", "DomElementsTreeView.AddElement", "DomCollectionControl.Add"}, { "SUBTRACT", "CollapseTreeNode", "Graph.ZoomOut"}, - { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EditorTab", "NextTemplateParameter"}, + { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EditorTab", "NextTemplateParameter", "ExpandLiveTemplateByTab"}, { "alt DOWN", "ShowContent", "MethodDown"}, { "alt F1", "SelectIn", "ProjectViewChangeView"}, { "alt INSERT", "FileChooser.NewFolder", "Generate", "NewElement"}, @@ -169,7 +169,7 @@ public abstract class KeymapsTestCase extends PlatformTestCase { put("Emacs", new String[][] { { "F2", "GotoNextError", "GuiDesigner.EditComponent", "GuiDesigner.EditGroup", "Console.TableResult.EditValue"}, { "alt ENTER", "ShowIntentionActions", "Console.TableResult.EditValue"}, - { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EmacsStyleIndent", "NextTemplateParameter"}, + { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EmacsStyleIndent", "NextTemplateParameter", "ExpandLiveTemplateByTab"}, { "alt DOWN", "ShowContent", "MethodDown"}, { "alt SLASH", "CodeCompletion", "HippieCompletion"}, { "control 0", "Unsplit", "GotoBookmark0"}, @@ -238,7 +238,7 @@ public abstract class KeymapsTestCase extends PlatformTestCase { { "F2", "Console.TableResult.EditValue", "QuickJavaDoc"}, { "alt ENTER", "Console.TableResult.EditValue", "ShowIntentionActions"}, { "F5", "UML.ApplyCurrentLayout", "StepInto"}, - { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EditorTab", "NextTemplateParameter"}, + { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EditorTab", "NextTemplateParameter", "ExpandLiveTemplateByTab"}, { "alt DOWN", "ShowContent", "MoveStatementDown"}, { "alt HOME", "ViewNavigationBar", "ShowNavBar"}, { "control F10", "ShowPopupMenu", "javaee.UpdateRunningApplication", "liveedit.UpdateRunningApplication"}, @@ -296,13 +296,13 @@ public abstract class KeymapsTestCase extends PlatformTestCase { { "shift control alt P", "Print", "Graph.Print"}, { "shift control K", "HippieCompletion", "hg4idea.push", "Git.Push"}, { "control alt E", "Console.History.Browse", "ExecuteInPyConsoleAction", "PerforceDirect.Edit"}, - { "TAB", "NextTemplateVariable", "NextParameter", "EditorTab", "EditorChooseLookupItemReplace", "EditorIndentSelection", "NextTemplateParameter"}, + { "TAB", "NextTemplateVariable", "NextParameter", "EditorTab", "EditorChooseLookupItemReplace", "EditorIndentSelection", "NextTemplateParameter", "ExpandLiveTemplateByTab"}, { "shift TAB", "EditorUnindentSelection", "PreviousTemplateVariable", "PrevParameter", "PrevTemplateParameter"}, }); put("JBuilder", new String[][] { { "F2", "EditorTab", "GuiDesigner.EditComponent", "GuiDesigner.EditGroup", "Console.TableResult.EditValue"}, { "F5", "ToggleBreakpointEnabled", "UML.ApplyCurrentLayout"}, - { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EmacsStyleIndent", "NextTemplateParameter"}, + { "TAB", "EditorChooseLookupItemReplace", "NextTemplateVariable", "NextParameter", "EditorIndentSelection", "EmacsStyleIndent", "NextTemplateParameter", "ExpandLiveTemplateByTab"}, { "control F6", "PreviousEditorTab", "PreviousTab", }, { "control M", "Vcs.ShowMessageHistory", "OverrideMethods", }, { "control N", "FileChooser.NewFolder", "GotoClass"}, diff --git a/resources/src/idea/RichPlatformActions.xml b/resources/src/idea/RichPlatformActions.xml index cffed91f0ebe..df6c28c3615e 100644 --- a/resources/src/idea/RichPlatformActions.xml +++ b/resources/src/idea/RichPlatformActions.xml @@ -7,7 +7,7 @@ - +