@Override public void paint(int reason) { if (fViewer.getDocument() == null) { deactivate(false); return; } StyledText textWidget= fViewer.getTextWidget(); // check selection if (hasMultiLineSelection(textWidget)) { deactivate(true); return; } // initialization if (!fIsActive) { textWidget.addLineBackgroundListener(this); fPositionManager.managePosition(fCurrentLine); fIsActive= true; } //redraw line highlight only if it hasn't been drawn yet on the respective line if (updateHighlightLine()) { // clear last line drawHighlightLine(fLastLine); // draw new line drawHighlightLine(fCurrentLine); } }
@Override public void paint(int reason) { if (fViewer.getDocument() == null) { deactivate(false); return; } StyledText textWidget= fViewer.getTextWidget(); // check selection if (hasMultiLineSelection(textWidget)) { deactivate(true); return; } // initialization if (!fIsActive) { textWidget.addLineBackgroundListener(this); fPositionManager.managePosition(fCurrentLine); fIsActive= true; } //redraw line highlight only if it hasn't been drawn yet on the respective line if (updateHighlightLine()) { // clear last line drawHighlightLine(fLastLine); // draw new line drawHighlightLine(fCurrentLine); } }