Example usage for com.intellij.openapi.keymap KeymapUtil matchActionMouseShortcutsModifiers

List of usage examples for com.intellij.openapi.keymap KeymapUtil matchActionMouseShortcutsModifiers

Introduction

In this page you can find the example usage for com.intellij.openapi.keymap KeymapUtil matchActionMouseShortcutsModifiers.

Prototype

public static boolean matchActionMouseShortcutsModifiers(@NotNull Keymap activeKeymap,
        @JdkConstants.InputEventMask int modifiers, @NotNull String actionId) 

Source Link

Document

Checks that one of the mouse shortcuts assigned to the provided action has the same modifiers as provided

Usage

From source file:com.intellij.codeInsight.navigation.CtrlMouseHandler.java

License:Apache License

@NotNull
private static BrowseMode getBrowseMode(@JdkConstants.InputEventMask int modifiers) {
    if (modifiers != 0) {
        final Keymap activeKeymap = KeymapManager.getInstance().getActiveKeymap();
        if (KeymapUtil.matchActionMouseShortcutsModifiers(activeKeymap, modifiers,
                IdeActions.ACTION_GOTO_DECLARATION))
            return BrowseMode.Declaration;
        if (KeymapUtil.matchActionMouseShortcutsModifiers(activeKeymap, modifiers,
                IdeActions.ACTION_GOTO_TYPE_DECLARATION))
            return BrowseMode.TypeDeclaration;
        if (KeymapUtil.matchActionMouseShortcutsModifiers(activeKeymap, modifiers,
                IdeActions.ACTION_GOTO_IMPLEMENTATION))
            return BrowseMode.Implementation;
        if (modifiers == InputEvent.CTRL_MASK || modifiers == InputEvent.META_MASK)
            return BrowseMode.Declaration;
    }/*from  w  w  w. jav  a  2 s. c o  m*/
    return BrowseMode.None;
}