Example usage for com.intellij.openapi.actionSystem IdeActions ACTION_EDITOR_MOVE_LINE_START

List of usage examples for com.intellij.openapi.actionSystem IdeActions ACTION_EDITOR_MOVE_LINE_START

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem IdeActions ACTION_EDITOR_MOVE_LINE_START.

Prototype

String ACTION_EDITOR_MOVE_LINE_START

To view the source code for com.intellij.openapi.actionSystem IdeActions ACTION_EDITOR_MOVE_LINE_START.

Click Source Link

Usage

From source file:com.hp.alm.ali.idea.ui.editor.field.HTMLAreaField.java

License:Apache License

public static void installNavigationShortCuts(final JTextPane desc) {
    Keymap keymap = KeymapManager.getInstance().getActiveKeymap();
    new AnAction() {
        public void actionPerformed(AnActionEvent e) {
            // default action moves to the end of the document - override
            desc.getActionMap().get(DefaultEditorKit.endLineAction).actionPerformed(null);
        }/*from w ww .ja va2  s. c o  m*/
    }.registerCustomShortcutSet(
            new CustomShortcutSet(keymap.getShortcuts(IdeActions.ACTION_EDITOR_MOVE_LINE_END)), desc);
    new AnAction() {
        public void actionPerformed(AnActionEvent e) {
            // default action moves to the beginning of the document - override
            desc.getActionMap().get(DefaultEditorKit.beginLineAction).actionPerformed(null);
        }
    }.registerCustomShortcutSet(
            new CustomShortcutSet(keymap.getShortcuts(IdeActions.ACTION_EDITOR_MOVE_LINE_START)), desc);
    new AnAction() {
        public void actionPerformed(AnActionEvent e) {
            // default action moves to the end of the document - override
            desc.getActionMap().get(DefaultEditorKit.selectionEndLineAction).actionPerformed(null);
        }
    }.registerCustomShortcutSet(
            new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK)), desc);
    new AnAction() {
        public void actionPerformed(AnActionEvent e) {
            // default action moves to the beginning of the document - override
            desc.getActionMap().get(DefaultEditorKit.selectionBeginLineAction).actionPerformed(null);
        }
    }.registerCustomShortcutSet(
            new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK)), desc);
    new AnAction() {
        public void actionPerformed(AnActionEvent e) {
            // when editing html insert hard break
            new InsertHardBreakAction().actionPerformed(null);
        }
    }.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)), desc);
}

From source file:com.intellij.testFramework.LightPlatformCodeInsightTestCase.java

License:Apache License

protected static void home() {
    executeAction(IdeActions.ACTION_EDITOR_MOVE_LINE_START);
}