undo/redo IdeActions

This commit is contained in:
peter
2011-07-08 13:02:34 +02:00
parent 055912b73f
commit 880fcba09d
2 changed files with 6 additions and 2 deletions
@@ -251,4 +251,7 @@ public interface IdeActions {
String ACTION_MOVE_STATEMENT_DOWN_ACTION = "MoveStatementDown";
String ACTION_COMPARE_CLIPBOARD_WITH_SELECTION = "CompareClipboardWithSelection";
String ACTION_UNDO = "$Undo";
String ACTION_REDO = "$Redo";
}
@@ -17,6 +17,7 @@
package com.intellij.ui;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.IdeActions;
import com.intellij.openapi.actionSystem.KeyboardShortcut;
import com.intellij.openapi.actionSystem.Shortcut;
import com.intellij.openapi.keymap.KeymapManager;
@@ -50,8 +51,8 @@ public class TextComponentUndoProvider implements Disposable {
myOldKeymap = myTextComponent.getKeymap();
Keymap keymap = JTextComponent.addKeymap(null, myOldKeymap);
com.intellij.openapi.keymap.Keymap activeKeymap = KeymapManager.getInstance().getActiveKeymap();
Shortcut[] undoShortcuts = activeKeymap.getShortcuts("$Undo");
Shortcut[] redoShortcuts = activeKeymap.getShortcuts("$Redo");
Shortcut[] undoShortcuts = activeKeymap.getShortcuts(IdeActions.ACTION_UNDO);
Shortcut[] redoShortcuts = activeKeymap.getShortcuts(IdeActions.ACTION_REDO);
Action undoAction = new AbstractAction ("Undo") {
public void actionPerformed(ActionEvent e) {