Example usage for com.intellij.openapi.actionSystem AbbreviationManager getInstance

List of usage examples for com.intellij.openapi.actionSystem AbbreviationManager getInstance

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem AbbreviationManager getInstance.

Prototype

public static AbbreviationManager getInstance() 

Source Link

Usage

From source file:com.codeflections.typengo.ActionFinder.java

License:Open Source License

private static List<String> tryFindWithSuffix(@NotNull String abbreviation) {
    final AbbreviationManager abbreviationManager = AbbreviationManager.getInstance();
    return abbreviationManager.findActions(abbreviation);
}

From source file:com.codeflections.typengo.ActionFinder.java

License:Open Source License

public static Collection<ActionInfo> findActions(String typedStr) {
    Set<String> abbreviations = AbbreviationManager.getInstance().getAbbreviations();
    Map<String, ActionInfo> foundActions = new TreeMap<>();
    for (String abbr : abbreviations) {
        if (abbr.startsWith(typedStr)) {
            ActionInfo found = findAction(abbr);
            if (found != null && !foundActions.containsKey(abbr)) {
                foundActions.put(abbr, found);
            }/* w  w  w  . ja v a  2 s. c o  m*/
        }
    }
    for (String abbr : BuiltInActions.getAbbreviations()) {
        if (abbr.startsWith(typedStr)) {
            ActionInfo found = findAction(abbr);
            if (found != null && !foundActions.containsKey(abbr)) {
                foundActions.put(abbr, found);
            }
        }
    }
    return foundActions.values();
}