My requirement is to highlight all occurrences of keywords when user double clicks on a word in eclipse rcp sql editor.
Problem is that already existing feature for syntax highlighting is gone when I override doubleclicked() method by extending DefaultTextDoubleClickStrategy and implementing ITextDoubleClickStrategy.
for (int i = 0; i < wrappers.size(); i++) {
presentation.addStyleRange(new StyleRange(wrappers.get(i)
.getStart(), wrappers.get(i).getEnd()
- wrappers.get(i).getStart(), attr.getForeground(), attr
.getBackground()));
text.changeTextPresentation(presentation, true);
}
text.changeTextPresentation is overlapping with syntax coloring behavior. It is conflicting and overriding Presentation reconciler functionality which damages and repairs sql editor changes.
How to prevent my double click strategy from overlapping with syntax coloring behavior? Can we do syntax coloring along with highlighting occurrences?
Any help is greatly appreciated.