Search in sources :

Example 11 with TypedAction

use of com.intellij.openapi.editor.actionSystem.TypedAction in project intellij-community by JetBrains.

the class ConsoleViewImplTest method testTypeInEmptyConsole.

public void testTypeInEmptyConsole() throws Exception {
    ConsoleViewImpl console = myConsole;
    console.clear();
    EditorActionManager actionManager = EditorActionManager.getInstance();
    DataContext dataContext = DataManager.getInstance().getDataContext(console.getComponent());
    TypedAction action = actionManager.getTypedAction();
    action.actionPerformed(console.getEditor(), 'h', dataContext);
    assertEquals(1, console.getContentSize());
}
Also used : EditorActionManager(com.intellij.openapi.editor.actionSystem.EditorActionManager) TypedAction(com.intellij.openapi.editor.actionSystem.TypedAction)

Example 12 with TypedAction

use of com.intellij.openapi.editor.actionSystem.TypedAction in project intellij-plugins by JetBrains.

the class HbActionHandlerTest method doCharTest.

/**
   * Call this method to test behavior when the given charToType is typed at the <caret>.
   * See class documentation for more info: {@link HbActionHandlerTest}
   */
void doCharTest(final char charToType, @NotNull String before, @NotNull String expected) {
    final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
    doExecuteActionTest(before, expected, () -> typedAction.actionPerformed(myFixture.getEditor(), charToType, ((EditorEx) myFixture.getEditor()).getDataContext()));
}
Also used : EditorEx(com.intellij.openapi.editor.ex.EditorEx) TypedAction(com.intellij.openapi.editor.actionSystem.TypedAction)

Aggregations

TypedAction (com.intellij.openapi.editor.actionSystem.TypedAction)12 EditorEx (com.intellij.openapi.editor.ex.EditorEx)5 EditorActionManager (com.intellij.openapi.editor.actionSystem.EditorActionManager)4 DataContext (com.intellij.openapi.actionSystem.DataContext)2 SimpleDataContext (com.intellij.openapi.actionSystem.impl.SimpleDataContext)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 HintHint (com.intellij.ui.HintHint)1 LightweightHint (com.intellij.ui.LightweightHint)1 File (java.io.File)1