Search in sources :

Example 1 with CursorActivityEvent

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

the class TextEditorPartViewImpl method setEditorWidget.

@Override
public void setEditorWidget(final EditorWidget editorWidget) {
    if (this.editorPanel.getWidget() != null) {
        throw new RuntimeException("Editor already set");
    }
    this.editorPanel.setWidget(editorWidget);
    editorWidget.addCursorActivityHandler(new CursorActivityHandler() {

        @Override
        public void onCursorActivity(final CursorActivityEvent event) {
            delegate.editorCursorPositionChanged();
        }
    });
    editorWidget.addBlurHandler(new BlurHandler() {

        @Override
        public void onBlur(final BlurEvent event) {
            delegate.editorLostFocus();
        }
    });
    editorWidget.addFocusHandler(new FocusHandler() {

        @Override
        public void onFocus(final FocusEvent event) {
            delegate.editorGotFocus();
        }
    });
}
Also used : CursorActivityEvent(org.eclipse.che.ide.api.editor.events.CursorActivityEvent) BlurHandler(com.google.gwt.event.dom.client.BlurHandler) FocusHandler(com.google.gwt.event.dom.client.FocusHandler) BlurEvent(com.google.gwt.event.dom.client.BlurEvent) CursorActivityHandler(org.eclipse.che.ide.api.editor.events.CursorActivityHandler) FocusEvent(com.google.gwt.event.dom.client.FocusEvent)

Aggregations

BlurEvent (com.google.gwt.event.dom.client.BlurEvent)1 BlurHandler (com.google.gwt.event.dom.client.BlurHandler)1 FocusEvent (com.google.gwt.event.dom.client.FocusEvent)1 FocusHandler (com.google.gwt.event.dom.client.FocusHandler)1 CursorActivityEvent (org.eclipse.che.ide.api.editor.events.CursorActivityEvent)1 CursorActivityHandler (org.eclipse.che.ide.api.editor.events.CursorActivityHandler)1