下面列出了怎么用org.eclipse.jface.text.source.AnnotationPainter的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Uninstalls the custom {@link AnnotationPainter annotation painter} from the given source
* viewer. If there is no custom annotation painter installed this method just returns.
*
* @param sourceViewer
* @param redraw
*/
public void uninstallPainter(ISourceViewer sourceViewer, boolean redraw) {
AnnotationPainter painter = installedPainters.remove(sourceViewer);
if (painter == null) return;
painter.deactivate(redraw);
painter.dispose();
}
@Override
protected ISourceViewer createSourceViewer(Composite parent,
org.eclipse.jface.text.source.IVerticalRuler ruler, int styles) {
SourceViewer sourceViewer = new SourceViewer(parent, ruler, styles);
sourceViewer.setEditable(false);
mPainter = new AnnotationPainter(sourceViewer, new AnnotationAccess());
sourceViewer.addPainter(mPainter);
return sourceViewer;
}