如何在TextEditor的子类中使用org.eclipse.jface.text.PaintManager?

如何在TextEditor的子类中使用org.eclipse.jface.text.PaintManager?,eclipse,eclipse-plugin,jface,Eclipse,Eclipse Plugin,Jface,如何将PaintManager附加到我的TextEditor? 例如,使用编辑器的TextViewer或SourceViewer提供的绘制管理器绘制光标线的背景。您可以使用查看器的ITextViewerExtension2界面访问它 例如,此代码来自SourceViewerDecorationSupport: private void showCursorLine(){ if(fCursorLinePainter==null){ if(ITextViewerExtension2的fSourceV

如何将
PaintManager
附加到我的
TextEditor

例如,使用编辑器的
TextViewer
SourceViewer
提供的绘制管理器绘制光标线的背景。您可以使用查看器的
ITextViewerExtension2
界面访问它

例如,此代码来自
SourceViewerDecorationSupport

private void showCursorLine(){
if(fCursorLinePainter==null){
if(ITextViewerExtension2的fSourceViewer实例){
fCursorLinePainter=新的CursorLinePainter(fSourceViewer);
setHighlightColor(getColor(fCursorLinePainterColorKey));
ITextViewerExtension2扩展=(ITextViewerExtension2)fSourceViewer;
扩展名.addPainter(fCursorLinePainter);
}
}
}

对不起,我是RCP的新手@greg-449。我有一个类ATEditor扩展文本编辑器。(我的编辑器来自plugin.xml)我接下来应该创建什么类,在我的ATEditor类中使用什么方法?如果你能回答我,我将非常感激。这会帮助我理解很多。如果您正在扩展
org.eclipse.ui.editors.text.TextEditor
,那么
SourceViewerDecorationSupport
已经安装在编辑器中,显示的内容由各种编辑器首选项控制。