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));
Object decorationType= getAnnotationDecorationType(annotationType);
if (decorationType != null)
fAnnotationPainter.addAnnotationType(annotationType, decorationType);