Undo operation is not giving previous changes completely
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Undo operation is not giving previous changes completely
Post by SmitaPatil »
Hi Team,
I am replacing the tag name and after that removing the attributes in one operation only, but when I am trying to undo it, I am able to get previous tag name but not the attributes of it.
I am using beginCompoundEdit() and endCompoundEdit(); to make this action as single operation.
Example :
Before changes :
Can you please let us know why its not undoing the operation properly.
Thanks,
Smita
I am replacing the tag name and after that removing the attributes in one operation only, but when I am trying to undo it, I am able to get previous tag name but not the attributes of it.
I am using beginCompoundEdit() and endCompoundEdit(); to make this action as single operation.
Example :
Before changes :
image.png
After changes :
image.png
After doing Undo :
image.png
As it is getting executed as single operation it should give previous tag name with attributes.Can you please let us know why its not undoing the operation properly.
Thanks,
Smita
You do not have the required permissions to view the files attached to this post.
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Undo operation is not giving previous changes completely
Hello,
You have to use the ro.sync.ecss.extensions.api.AuthorDocumentController.setAttribute(String, AttrValue, AuthorElement) API to set attributes for an element and to make sure that undo/redo will function properly.
You can also use AuthorDocumentController.setMultipleDistinctAttributes(int, int[], List<Map<String, AttrValue>>) or AuthorDocumentController.setMultipleAttributes(int, int[], Map<String, AttrValue>) to set multiple attributes once.
Best regards,
Mihaela
You have to use the ro.sync.ecss.extensions.api.AuthorDocumentController.setAttribute(String, AttrValue, AuthorElement) API to set attributes for an element and to make sure that undo/redo will function properly.
You can also use AuthorDocumentController.setMultipleDistinctAttributes(int, int[], List<Map<String, AttrValue>>) or AuthorDocumentController.setMultipleAttributes(int, int[], Map<String, AttrValue>) to set multiple attributes once.
Best regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: Undo operation is not giving previous changes completely
Post by SmitaPatil »
Hi Mihaela,
I have developed one custom plugin to renaming tag name and after that removing attribute, if I do undo It is just displaying previous tag name not the attribute. (Attached the screenshot last time)
I am saying about this undo
If I click on this undo it is just giving the previous tag name not the previous attribute.
Can you please check and let me know?
Please let me know if you have any questions.
Thanks & Regards,
Smita
I have developed one custom plugin to renaming tag name and after that removing attribute, if I do undo It is just displaying previous tag name not the attribute. (Attached the screenshot last time)
I am saying about this undo
image.png
which is present in Oxygen web author.If I click on this undo it is just giving the previous tag name not the previous attribute.
Can you please check and let me know?
Please let me know if you have any questions.
Thanks & Regards,
Smita
-
- Posts: 515
- Joined: Wed May 20, 2009 2:40 pm
Re: Undo operation is not giving previous changes completely
Hi,
If you used ro.sync.ecss.extensions.api.node.AuthorElement.removeAttribute(String) you have to change the code to use the ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement) API.
The reason is that the first method must be used only when the element is from an {@link AuthorDocumentFragment} and not from the current Author document content. All operations on nodes from the document model must be done using the AuthorDocumentController methods (and they will be subject to undo/redo).
Best Regards,
Mihaela
If you used ro.sync.ecss.extensions.api.node.AuthorElement.removeAttribute(String) you have to change the code to use the ro.sync.ecss.extensions.api.AuthorDocumentController.removeAttribute(String, AuthorElement) API.
The reason is that the first method must be used only when the element is from an {@link AuthorDocumentFragment} and not from the current Author document content. All operations on nodes from the document model must be done using the AuthorDocumentController methods (and they will be subject to undo/redo).
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
http://www.oxygenxml.com
-
- Posts: 93
- Joined: Mon Aug 08, 2022 2:32 pm
Re: Undo operation is not giving previous changes completely
Post by SmitaPatil »
Hi Mihaela,
Thank you so much.
Thanks,
Smita
Thank you so much.
Thanks,
Smita
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service