Search in sources :

Example 1 with GutterClickEvent

use of org.eclipse.che.ide.api.editor.events.GutterClickEvent 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)

Example 2 with GutterClickEvent

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

the class OrionEditorWidget method fireGutterClickEvent.

private void fireGutterClickEvent(final int line) {
    final GutterClickEvent gutterEvent = new GutterClickEvent(line, Gutters.BREAKPOINTS_GUTTER, null);
    fireEvent(gutterEvent);
    this.embeddedDocument.getDocEventBus().fireEvent(gutterEvent);
}
Also used : GutterClickEvent(org.eclipse.che.ide.api.editor.events.GutterClickEvent)

Aggregations

GutterClickEvent (org.eclipse.che.ide.api.editor.events.GutterClickEvent)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)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