Highlight certain Tags in the XMLEditor

<oXygen/> general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Highlight certain Tags in the XMLEditor

Post by SSC » Fri Jun 01, 2012 4:01 pm

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
Simon Scholz
vogella GmbH
http://www.vogella.com

Radu
Posts: 6582
Joined: Fri Jul 09, 2004 5:18 pm

Re: Highlight certain Tags in the XMLEditor

Post by Radu » Fri Jun 01, 2012 4:16 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

Re: Highlight certain Tags in the XMLEditor

Post by SSC » Sat Jun 02, 2012 12:40 pm

Thanks for your answer.
It works well :)
Simon Scholz
vogella GmbH
http://www.vogella.com

Post Reply