Example usage for com.intellij.openapi.editor.actionSystem EditorAction setupHandler

List of usage examples for com.intellij.openapi.editor.actionSystem EditorAction setupHandler

Introduction

In this page you can find the example usage for com.intellij.openapi.editor.actionSystem EditorAction setupHandler.

Prototype

public synchronized final EditorActionHandler setupHandler(@NotNull EditorActionHandler newHandler) 

Source Link

Usage

From source file:com.maddyhome.idea.vim.key.KeyParser.java

License:Open Source License

public void setupActionHandler(String ideaActName, String vimActName, KeyStroke stroke, boolean special) {
    if (logger.isDebugEnabled())
        logger.debug("setupActionHandler for " + ideaActName + " and " + vimActName + " for " + stroke);
    ActionManager amgr = ActionManager.getInstance();
    AnAction action = amgr.getAction(ideaActName);
    if (action instanceof EditorAction) {
        if (logger.isDebugEnabled())
            logger.debug(ideaActName + " is an EditorAction");
        EditorAction iaction = (EditorAction) action;
        EditorActionHandler handler = iaction.getHandler();
        if (vimActName != null) {
            EditorAction vaction = (EditorAction) amgr.getAction(vimActName);
            vaction.setupHandler(handler);
        }// w w  w  . ja va 2s  . c o m

        iaction.setupHandler(new EditorKeyHandler(handler, stroke, special));
    }

    //removePossibleConflict(stroke);
}