Search in sources :

Example 1 with GutterClickHandler

use of org.eclipse.che.ide.api.editor.events.GutterClickHandler in project che by eclipse.

the class OrionEditorPresenter method setupEventHandlers.

private void setupEventHandlers() {
    this.editorWidget.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(final ChangeEvent event) {
            handleDocumentChanged();
        }
    });
    this.editorWidget.addGutterClickHandler(new GutterClickHandler() {

        @Override
        public void onGutterClick(final GutterClickEvent event) {
            if (Gutters.BREAKPOINTS_GUTTER.equals(event.getGutterId()) || Gutters.LINE_NUMBERS_GUTTER.equals(event.getGutterId())) {
                breakpointManager.changeBreakpointState(event.getLineNumber());
            }
        }
    });
    this.editorWidget.addKeyBinding(new KeyBinding(true, false, false, false, KeyCodes.KEY_F8, new KeyBindingAction() {

        @Override
        public boolean action() {
            int currentLine = editorWidget.getDocument().getCursorPosition().getLine();
            breakpointManager.changeBreakpointState(currentLine);
            return true;
        }
    }), TOGGLE_LINE_BREAKPOINT);
}
Also used : KeyBinding(org.eclipse.che.ide.api.editor.keymap.KeyBinding) GutterClickEvent(org.eclipse.che.ide.api.editor.events.GutterClickEvent) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) GutterClickHandler(org.eclipse.che.ide.api.editor.events.GutterClickHandler) KeyBindingAction(org.eclipse.che.ide.api.editor.keymap.KeyBindingAction)

Aggregations

ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 GutterClickEvent (org.eclipse.che.ide.api.editor.events.GutterClickEvent)1 GutterClickHandler (org.eclipse.che.ide.api.editor.events.GutterClickHandler)1 KeyBinding (org.eclipse.che.ide.api.editor.keymap.KeyBinding)1 KeyBindingAction (org.eclipse.che.ide.api.editor.keymap.KeyBindingAction)1