undo list access

Find out <oXygen/> related news.
Chemo
Posts: 20

undo list access

Fri Feb 08, 2013 7:56 pm

Hi.

I am developing a plugin, which dynamically creates permanent highlights in the text.
My problem is, that Oxygen sees this automatically created highlights as text changes and adds these changes to the undo list. This ist very uncomfortable for the user, because if he wants to undo (Ctrl+Z) the changes he just made and my plugin just added like 20 highlights, he has to undo all this highlights first.
Is there a way to get access to the undo list or even better a way to prevent oxygen understanding the hightlights as text changes and adding them to the undo history list?

Thanks,
Thomas.
Radu
Posts: 5088

Re: undo list access

Mon Feb 11, 2013 10:10 am

Hi Thomas,

Sorry but no. Persistent highlights represent real modifications which are made to the current document and they are serialized in the saved XML file as processing instructions.
The list of undoable edits (undo/redo) needs to be consistent, to contain all changes which influence the output XML document.

What you could do when you add persistent highlights would be to make a single edit out of this by calling:

Code: Select all

try{
ro.sync.ecss.extensions.api.AuthorDocumentController.beginCompoundEdit()
 ///TODO Then you add all the highlights by calling our API
} finally{
 ro.sync.ecss.extensions.api.AuthorDocumentController.endCompoundEdit()
}



In this way a single "Undo" operation will remove all your highlights.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest