mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-54780 flex: "Copy Reference" action should work for references, not only definitions
This commit is contained in:
@@ -16,11 +16,12 @@
|
||||
package com.intellij.testFramework;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedAction;
|
||||
import junit.framework.Assert;
|
||||
|
||||
/**
|
||||
* User: Maxim.Mossienko
|
||||
@@ -49,4 +50,21 @@ public class EditorTestUtil {
|
||||
action.actionPerformed(editor, c, DataManager.getInstance().getDataContext());
|
||||
}
|
||||
}
|
||||
|
||||
public static void performReferenceCopy(DataContext dataContext) {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
AnAction action = actionManager.getAction(IdeActions.ACTION_COPY_REFERENCE);
|
||||
AnActionEvent
|
||||
event = new AnActionEvent(null, dataContext, "", action.getTemplatePresentation(),
|
||||
ActionManager.getInstance(), 0);
|
||||
action.update(event);
|
||||
Assert.assertTrue(event.getPresentation().isEnabled());
|
||||
action.actionPerformed(event);
|
||||
}
|
||||
|
||||
public static void performPaste(Editor editor) {
|
||||
EditorActionManager actionManager = EditorActionManager.getInstance();
|
||||
EditorActionHandler actionHandler = actionManager.getActionHandler(IdeActions.ACTION_EDITOR_PASTE);
|
||||
actionHandler.execute(editor, DataManager.getInstance().getDataContext());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user