diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java index 3b0db5201816..8320022e11eb 100644 --- a/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java +++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java @@ -260,4 +260,5 @@ public interface IdeActions { String CHANGES_VIEW_ROLLBACK = "ChangesView.Rollback"; String CONSOLE_CLEAR_ALL = "ConsoleView.ClearAll"; + String MOVE_TO_ANOTHER_CHANGE_LIST = "ChangesView.Move"; } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsQuickListPopupAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsQuickListPopupAction.java index e95d051f9140..d3ec84680049 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsQuickListPopupAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsQuickListPopupAction.java @@ -113,7 +113,7 @@ public class VcsQuickListPopupAction extends QuickSwitchSchemeAction implements // additional stuff addSeparator(group); - addAction("ChangesView.Move", group); + addAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST, group); // local history addLocalHistoryActions(group); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java index 74b3f885a18f..5d8b1223bb1e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java @@ -247,7 +247,7 @@ public class ChangesViewManager implements ChangesViewI, JDOMExternalizable, Pro ActionManager.getInstance().getAction("ChangesView.Refresh").registerCustomShortcutSet(CommonShortcuts.getRerun(), panel); ActionManager.getInstance().getAction("ChangesView.NewChangeList").registerCustomShortcutSet(CommonShortcuts.getNew(), panel); ActionManager.getInstance().getAction("ChangesView.RemoveChangeList").registerCustomShortcutSet(CommonShortcuts.DELETE, panel); - ActionManager.getInstance().getAction("ChangesView.Move").registerCustomShortcutSet(CommonShortcuts.getMove(), panel); + ActionManager.getInstance().getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST).registerCustomShortcutSet(CommonShortcuts.getMove(), panel); ActionManager.getInstance().getAction("ChangesView.Rename").registerCustomShortcutSet(CommonShortcuts.getRename(), panel); ActionManager.getInstance().getAction("ChangesView.SetDefault").registerCustomShortcutSet( new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.ALT_DOWN_MASK | ctrlMask())), panel); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java index 3bf423591d7a..8a672edfbca3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/UnversionedViewDialog.java @@ -120,7 +120,7 @@ public class UnversionedViewDialog extends DialogWrapper { actions.add(new ToggleShowFlattenAction()); AnAction addAction = ActionManager.getInstance().getAction("ChangesView.AddUnversioned.From.Dialog"); - AnAction moveAction = ActionManager.getInstance().getAction("ChangesView.Move"); + AnAction moveAction = ActionManager.getInstance().getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST); AnAction deleteAction = ActionManager.getInstance().getAction("ChangesView.DeleteUnversioned.From.Dialog"); AnAction ignoreAction = ActionManager.getInstance().getAction("ChangesView.Ignore"); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/MoveChangesToAnotherListAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/MoveChangesToAnotherListAction.java index d95a9660ca22..031b9be2a1ab 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/MoveChangesToAnotherListAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/MoveChangesToAnotherListAction.java @@ -15,11 +15,9 @@ */ package com.intellij.openapi.vcs.changes.actions; +import com.intellij.icons.AllIcons; import com.intellij.idea.ActionsBundle; -import com.intellij.openapi.actionSystem.ActionPlaces; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; @@ -42,6 +40,12 @@ import java.util.*; */ public class MoveChangesToAnotherListAction extends AnAction implements DumbAware { + public MoveChangesToAnotherListAction() { + super(ActionsBundle.actionText(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST), + ActionsBundle.actionDescription(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST), + AllIcons.Actions.MoveToAnotherChangelist); + } + public void update(AnActionEvent e) { final boolean isEnabled = isEnabled(e); if (ActionPlaces.isPopupPlace(e.getPlace())) { @@ -51,7 +55,7 @@ public class MoveChangesToAnotherListAction extends AnAction implements DumbAwar e.getPresentation().setEnabled(isEnabled); } } - + private static boolean isEnabled(final AnActionEvent e) { final Project project = e.getData(PlatformDataKeys.PROJECT); if (project == null) return false; @@ -76,7 +80,7 @@ public class MoveChangesToAnotherListAction extends AnAction implements DumbAwar if (ProjectLevelVcsManager.getInstance(project).getAllActiveVcss().length == 0) { return null; } - + final ChangeListManager changeListManager = ChangeListManager.getInstance(project); VirtualFile[] virtualFiles = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY); if (virtualFiles != null) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java index fedc1ef48a4a..7d827639f464 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/MultipleChangeListBrowser.java @@ -24,6 +24,7 @@ package com.intellij.openapi.vcs.changes.ui; import com.intellij.icons.AllIcons; import com.intellij.openapi.actionSystem.*; +import com.intellij.openapi.actionSystem.ex.AnActionListener; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.project.Project; @@ -205,12 +206,16 @@ public class MultipleChangeListBrowser extends ChangesBrowser { protected void buildToolBar(final DefaultActionGroup toolBarGroup) { super.buildToolBar(toolBarGroup); - final MoveChangesToAnotherListAction moveAction = new MoveChangesToAnotherListAction() { - public void actionPerformed(AnActionEvent e) { - super.actionPerformed(e); - rebuildList(); + ActionManager actionManager = ActionManager.getInstance(); + final AnAction moveAction = actionManager.getAction(IdeActions.MOVE_TO_ANOTHER_CHANGE_LIST); + actionManager.addAnActionListener(new AnActionListener.Adapter() { + @Override + public void afterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) { + if (moveAction.equals(action)) { + rebuildList(); + } } - }; + }); moveAction.registerCustomShortcutSet(CommonShortcuts.getMove(), myViewer); toolBarGroup.add(moveAction);