How can I use org.eclipse.jface.text.PaintManager in subclass of TextEditor? -
how can attach paintmanager
texteditor
? example, draw background of cursor line org.eclipse.jface.text.cursorlinepainter
.
your editor's textviewer
or sourceviewer
provides paint manager. can access using itextviewerextension2
interface of viewer.
for example code sourceviewerdecorationsupport
:
private void showcursorline() { if (fcursorlinepainter == null) { if (fsourceviewer instanceof itextviewerextension2) { fcursorlinepainter = new cursorlinepainter(fsourceviewer); fcursorlinepainter.sethighlightcolor(getcolor(fcursorlinepaintercolorkey)); itextviewerextension2 extension = (itextviewerextension2) fsourceviewer; extension.addpainter(fcursorlinepainter); } } }
Comments
Post a Comment