@Override public void deactivate(boolean redraw) { if (fIsActive) { fIsActive= false; /* on turning off the feature one has to paint the currently * highlighted line with the standard background color */ if (redraw) drawHighlightLine(fCurrentLine); fViewer.getTextWidget().removeLineBackgroundListener(this); if (fPositionManager != null) fPositionManager.unmanagePosition(fCurrentLine); fLastLineNumber= -1; fCurrentLine.offset= 0; fCurrentLine.length= 0; } }
@Override public void deactivate(boolean redraw) { if (fIsActive) { fIsActive= false; /* on turning off the feature one has to paint the currently * highlighted line with the standard background color */ if (redraw) drawHighlightLine(fCurrentLine); fViewer.getTextWidget().removeLineBackgroundListener(this); if (fPositionManager != null) fPositionManager.unmanagePosition(fCurrentLine); fLastLineNumber= -1; fCurrentLine.offset= 0; fCurrentLine.length= 0; } }
@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); } }