Search in sources :

Example 1 with CharCodeWithModifiers

use of org.eclipse.che.ide.util.input.CharCodeWithModifiers in project che by eclipse.

the class HotKeysDialogPresenter method getIDEHotKey.

private List<HotKeyItem> getIDEHotKey() {
    List<HotKeyItem> ideHotKeys = new ArrayList<>();
    Scheme scheme = keyBindingAgent.getScheme(selectedSchemeId);
    for (String actionId : actionManager.getActionIds("")) {
        boolean isGlobal = false;
        CharCodeWithModifiers activeCharCodeWithModifiers = scheme.getKeyBinding(actionId);
        if (activeCharCodeWithModifiers == null) {
            activeCharCodeWithModifiers = keyBindingAgent.getKeyBinding(actionId);
            isGlobal = true;
        }
        if (activeCharCodeWithModifiers != null) {
            String hotKey = KeyMapUtil.getShortcutText(activeCharCodeWithModifiers);
            String description = actionManager.getAction(actionId).getTemplatePresentation().getDescription();
            if (description != null && !description.isEmpty()) {
                ideHotKeys.add(new HotKeyItem(description, hotKey, isGlobal));
            }
        }
    }
    return ideHotKeys;
}
Also used : HotKeyItem(org.eclipse.che.ide.api.hotkeys.HotKeyItem) Scheme(org.eclipse.che.ide.api.keybinding.Scheme) CharCodeWithModifiers(org.eclipse.che.ide.util.input.CharCodeWithModifiers) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 HotKeyItem (org.eclipse.che.ide.api.hotkeys.HotKeyItem)1 Scheme (org.eclipse.che.ide.api.keybinding.Scheme)1 CharCodeWithModifiers (org.eclipse.che.ide.util.input.CharCodeWithModifiers)1