Page 1 of 1

Highlight certain Tags in the XMLEditor

Posted: Fri Jun 01, 2012 4:01 pm
by SSC
Hello,

We use your Oxygen Eclipse plugin in Version 13.2.

Our issue:
We´d like to highlight certain Tags in the XMLEditor during runtime of the program.
I already implemented a breadcrumb for the XML hierarchy and when you click on one of those breadcrumbs the selected XML TAG will be selected in the XMLEditor.
Now I got a feature request that a certain XML TAG should be highlighted, when I hover over a breadcrumb with the mouse cursor.

Is there maybe a way to alter the CSS of a certain AuthorNode on the fly during runtime, in order to highlight it?
Or could you imagine a different approach to highlight a certain AuthorNode in the XMLEditor?

Best regards,

Simon

Re: Highlight certain Tags in the XMLEditor

Posted: Fri Jun 01, 2012 4:16 pm
by Radu
Hello Simon,

For the Author page we have this API method:

Code: Select all

ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.getHighlighter()
which would allow you to add a highlight between certain offsets (the hovered AuthorNode's start and end offsets for example) with a certain painter.
As a painte you can use an instance of:

Code: Select all

ro.sync.ecss.extensions.api.highlights.ColorHighlightPainter
You could probably add a caret listener and remove the highlight when the caret is moved.

Regards,
Radu

Re: Highlight certain Tags in the XMLEditor

Posted: Sat Jun 02, 2012 12:40 pm
by SSC
Thanks for your answer.
It works well :)