Search in sources :

Example 1 with HasAnnotationRendering

use of org.eclipse.che.ide.api.editor.annotation.HasAnnotationRendering in project che by eclipse.

the class OrionEditorInit method configureAnnotationModel.

/**
     * Configures the editor's annotation model.
     * @param documentHandle the handle on the editor
     */
private void configureAnnotationModel(final DocumentHandle documentHandle) {
    final AnnotationModel annotationModel = configuration.getAnnotationModel();
    if (annotationModel == null) {
        return;
    }
    // add the renderers (event handler) before the model (event source)
    if (textEditor instanceof HasAnnotationRendering) {
        ((HasAnnotationRendering) textEditor).configure(annotationModel, documentHandle);
    }
    annotationModel.setDocumentHandle(documentHandle);
    documentHandle.getDocEventBus().addHandler(DocumentChangeEvent.TYPE, annotationModel);
    // the model listens to QueryAnnotation events
    documentHandle.getDocEventBus().addHandler(QueryAnnotationsEvent.TYPE, annotationModel);
}
Also used : HasAnnotationRendering(org.eclipse.che.ide.api.editor.annotation.HasAnnotationRendering) AnnotationModel(org.eclipse.che.ide.api.editor.annotation.AnnotationModel)

Aggregations

AnnotationModel (org.eclipse.che.ide.api.editor.annotation.AnnotationModel)1 HasAnnotationRendering (org.eclipse.che.ide.api.editor.annotation.HasAnnotationRendering)1