Search in sources :

Example 1 with OrionKeyBindingsRelationOverlay

use of org.eclipse.che.ide.editor.orion.client.jso.OrionKeyBindingsRelationOverlay in project che by eclipse.

the class OrionEditorWidget method getHotKeys.

@Override
public List<HotKeyItem> getHotKeys() {
    OrionTextViewOverlay orionTextViewOverlay = editorOverlay.getTextView();
    List<HotKeyItem> hotKeyItems = new ArrayList<>();
    JsArray<OrionKeyBindingsRelationOverlay> keyBindings = OrionKeyModeOverlay.getKeyBindings_(orionTextViewOverlay);
    for (int i = 0; i < keyBindings.length(); i++) {
        OrionKeyBindingsRelationOverlay key = keyBindings.get(i);
        String actionId = key.getActionId();
        String actionDescription = orionTextViewOverlay.getActionDescription(actionId);
        String hotKey = UiUtilsOverlay.getUserKeyString(uiUtilsOverlay, key.getKeyBindings());
        if (actionDescription != null) {
            hotKeyItems.add(new HotKeyItem(actionDescription, hotKey));
        }
    }
    return hotKeyItems;
}
Also used : HotKeyItem(org.eclipse.che.ide.api.hotkeys.HotKeyItem) OrionKeyBindingsRelationOverlay(org.eclipse.che.ide.editor.orion.client.jso.OrionKeyBindingsRelationOverlay) ArrayList(java.util.ArrayList) OrionTextViewOverlay(org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay)

Aggregations

ArrayList (java.util.ArrayList)1 HotKeyItem (org.eclipse.che.ide.api.hotkeys.HotKeyItem)1 OrionKeyBindingsRelationOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionKeyBindingsRelationOverlay)1 OrionTextViewOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay)1