use of org.eclipse.jface.text.source.IAnnotationAccess in project eclipse.platform.text by eclipse.
the class InlinedAnnotationDemo method createAnnotationPainter.
/**
* Create annotation painter.
*
* @param viewer
* the viewer.
* @return annotation painter.
*/
private static AnnotationPainter createAnnotationPainter(ISourceViewer viewer) {
IAnnotationAccess annotationAccess = new IAnnotationAccess() {
@Override
public Object getType(Annotation annotation) {
return annotation.getType();
}
@Override
public boolean isMultiLine(Annotation annotation) {
return true;
}
@Override
public boolean isTemporary(Annotation annotation) {
return true;
}
};
AnnotationPainter painter = new AnnotationPainter(viewer, annotationAccess);
((ITextViewerExtension2) viewer).addPainter(painter);
return painter;
}
Aggregations