if (fSourceViewer instanceof ITextViewerExtension2) {
if (fAnnotationPainter == null) {
fAnnotationPainter= createAnnotationPainter();
if (fSourceViewer instanceof ITextViewerExtension4)
((ITextViewerExtension4)fSourceViewer).addTextPresentationListener(fAnnotationPainter);
ITextViewerExtension2 extension= (ITextViewerExtension2) fSourceViewer;
extension.addPainter(fAnnotationPainter);
}
fAnnotationPainter.setAnnotationTypeColor(annotationType, getAnnotationTypeColor(annotationType));
if (highlighting)
fAnnotationPainter.addHighlightAnnotationType(annotationType);
else {