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);
}
Aggregations