org.eclipse.swt.custom.CaretListener Java Examples

The following examples show how to use org.eclipse.swt.custom.CaretListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModulaOccurrencesMarker.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
public void setViewer(ISourceViewer viewer, SourceCodeTextEditor sourceEditor) {
    if (this.viewer != null) {
        LogHelper.logError("ModulaOccurrencesMarker.setViewer() is called more than one time!"); // $//$NON-NLS-1$
    } else {
        this.viewer = viewer;
        this.sourceEditor = sourceEditor;
        viewer.getTextWidget().addCaretListener(new CaretListener() {
            @Override
            public void caretMoved(CaretEvent event) {
                caretOffset = event.caretOffset;
                reMark(false);
            }
        });
    }
}