Search in sources :

Example 6 with OrionTextViewOverlay

use of org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay 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)

Example 7 with OrionTextViewOverlay

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

the class OrionEditorWidget method addFocusHandler.

@Override
public HandlerRegistration addFocusHandler(FocusHandler handler) {
    if (!focusHandlerAdded) {
        focusHandlerAdded = true;
        final OrionTextViewOverlay textView = this.editorOverlay.getTextView();
        textView.addEventListener(OrionEventConstants.FOCUS_EVENT, new OrionTextViewOverlay.EventHandlerNoParameter() {

            @Override
            public void onEvent() {
                fireFocusEvent();
            }
        });
    }
    return addHandler(handler, FocusEvent.getType());
}
Also used : OrionTextViewOverlay(org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay)

Aggregations

OrionTextViewOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionTextViewOverlay)7 Element (elemental.dom.Element)1 SpanElement (elemental.html.SpanElement)1 Window (elemental.html.Window)1 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 OrionPixelPositionOverlay (org.eclipse.che.ide.editor.orion.client.jso.OrionPixelPositionOverlay)1