Hi Daniel,
How exactly did you start using our API for the customization?
Did you implement a Workspace Access Plugin using our Plugins SDK?
http://www.oxygenxml.com/oxygen_sdk.htm ... ne_plugins
A Workspace Access Plugin allows you to see what editor is current selected (
ro.sync.exml.workspace.api.editor.WSEditor API) and to see what editor mode (Text, Grid or Author) is currently selected using
ro.sync.exml.workspace.api.editor.WSEditor.getCurrentPage().
Then this page can either be an instance of
ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPage for the Author editing mode or
ro.sync.exml.workspace.api.editor.page.text.xml.WSXMLTextEditorPage for the Text editing mode.
The Text and Author editing modes have totally different internal models. The Text editing mode is based on a regular Java Swing
javax.swing.JTextArea and can be obtained using the API
ro.sync.exml.workspace.api.editor.page.text.WSTextEditorPage.getTextComponent() and then use the regular Swing API for adding highlights:
Code: Select all
WSTextEditorPage currentPage = (WSTextEditorPage)editor.getCurrentPage();
Object textComponent = currentPage.getTextComponent();
if (textComponent instanceof JTextArea) {
JTextArea textArea = (JTextArea) textComponent;
Highlighter highlighther = textArea.getHighlighter();
highlighther.addHighlight(p0, p1, p)
}
Maybe this similar topic would also help:
http://www.oxygenxml.com/forum/topic10519.html
Regards,
Radu