textViewer.changeTextPresentation (presentación, verdadero) en eclipse elimina el resaltado de sintaxis

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?

Cualquier ayuda es muy apreciada.

preguntado el 13 de septiembre de 13 a las 10:09

Could be a problem in the SourceViewerConfiguration (or derived class) used to specify the double click strategy. -

Thanks. I am using textviewer.changetextpresentation(presentation, true) to set styleRange to selected region. This is overriding default eclipse sql editor syntax coloring. How to restore syntax coloring behavior along with retaining highlighted behavior? -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.