textViewer.changeTextPresentation (presentación, verdadero) en eclipse elimina el resaltado de sintaxis
Frecuentes
Visto 222 veces
0
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.
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas eclipse-plugin swt syntax-highlighting jface text-coloring or haz tu propia pregunta.
Could be a problem in the SourceViewerConfiguration (or derived class) used to specify the double click strategy. - greg-449
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? - rohitha