use of com.intellij.openapi.editor.actionSystem.TypedAction in project intellij-community by JetBrains.
the class LightPlatformCodeInsightTestCase method type.
public static void type(char c, @NotNull Editor editor, Project project) {
if (c == '\n') {
executeAction(IdeActions.ACTION_EDITOR_ENTER, editor, project);
} else {
EditorActionManager actionManager = EditorActionManager.getInstance();
final DataContext dataContext = DataManager.getInstance().getDataContext();
TypedAction action = actionManager.getTypedAction();
action.actionPerformed(editor, c, dataContext);
}
}
use of com.intellij.openapi.editor.actionSystem.TypedAction in project ideavim by JetBrains.
the class VimPlugin method initComponent.
@Override
public void initComponent() {
LOG.debug("initComponent");
Notifications.Bus.register(IDEAVIM_STICKY_NOTIFICATION_ID, NotificationDisplayType.STICKY_BALLOON);
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
updateState();
}
});
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
EventFacade.getInstance().setupTypedActionHandler(new VimTypedActionHandler(typedAction.getRawHandler()));
// Register vim actions in command mode
RegisterActions.registerActions();
// Add some listeners so we can handle special events
setupListeners();
// Register ex handlers
CommandParser.getInstance().registerHandlers();
if (!ApplicationManager.getApplication().isUnitTestMode()) {
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
if (ideaVimRc != null) {
VimScriptParser.executeFile(ideaVimRc);
}
}
LOG.debug("done");
}
use of com.intellij.openapi.editor.actionSystem.TypedAction in project ideavim by JetBrains.
the class EventFacade method setupTypedActionHandler.
public void setupTypedActionHandler(@NotNull TypedActionHandler handler) {
final TypedAction typedAction = getTypedAction();
myOriginalTypedActionHandler = typedAction.getRawHandler();
typedAction.setupRawHandler(handler);
}
use of com.intellij.openapi.editor.actionSystem.TypedAction in project intellij-community by JetBrains.
the class SelectionQuotingTypedHandlerTest method testRuby7852ErrantEditor.
public void testRuby7852ErrantEditor() {
myFixture.configureByText(FileTypes.PLAIN_TEXT, "\"aaa\"\nbbb\n\n");
myFixture.getEditor().getCaretModel().moveToOffset(0);
myFixture.getEditor().getSelectionModel().setSelection(0, 5);
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
performAction(myFixture.getProject(), () -> typedAction.actionPerformed(myFixture.getEditor(), '\'', ((EditorEx) myFixture.getEditor()).getDataContext()));
myFixture.getEditor().getSelectionModel().removeSelection();
myFixture.checkResult("'aaa'\nbbb\n\n");
myFixture.getEditor().getCaretModel().moveToOffset(myFixture.getEditor().getDocument().getLineStartOffset(3));
performAction(myFixture.getProject(), () -> {
typedAction.actionPerformed(myFixture.getEditor(), 'A', ((EditorEx) myFixture.getEditor()).getDataContext());
typedAction.actionPerformed(myFixture.getEditor(), 'B', ((EditorEx) myFixture.getEditor()).getDataContext());
});
myFixture.checkResult("'aaa'\nbbb\n\nAB");
}
use of com.intellij.openapi.editor.actionSystem.TypedAction in project intellij-community by JetBrains.
the class ConsoleViewImplTest method typeIn.
private static void typeIn(Editor editor, char c) {
TypedAction action = EditorActionManager.getInstance().getTypedAction();
DataContext dataContext = ((EditorEx) editor).getDataContext();
action.actionPerformed(editor, c, dataContext);
}
Aggregations