Evaluate Node Collection of Selection
Oxygen general issues.
-
- Posts: 12
- Joined: Thu May 11, 2017 10:18 pm
Evaluate Node Collection of Selection
Post by jacobBocaj »
Hello,
I would like to prevent the deletion of <title> elements (and their content) within an xml document if the <title> element has an attribute of 'hTitle'. Thus far I have managed to prevent the deletion of element content by overidding the 'delete' method in an extension class of AuthorDocumentFilter; within this overridden 'delete' method I check the node at the caret and stop the content deletion if the 'hTitle' attribute exist. This works great if the user attempts to delete content at the cursor position.
However, when the user attempts a delete operation on a selection spanning a collection of elements I am unable to find a working approach to check the element content of the selection and stop the deletion operation. Is there a class method to access the element content of a selection? I tried to use getFullySelectedNode form WSAuthorEditorPageBase in hopes that I could parse the children of that node, but I wan't able to make that work.
Any advice will be greatly appreciated.
Thanks,
Jacob
I would like to prevent the deletion of <title> elements (and their content) within an xml document if the <title> element has an attribute of 'hTitle'. Thus far I have managed to prevent the deletion of element content by overidding the 'delete' method in an extension class of AuthorDocumentFilter; within this overridden 'delete' method I check the node at the caret and stop the content deletion if the 'hTitle' attribute exist. This works great if the user attempts to delete content at the cursor position.
However, when the user attempts a delete operation on a selection spanning a collection of elements I am unable to find a working approach to check the element content of the selection and stop the deletion operation. Is there a class method to access the element content of a selection? I tried to use getFullySelectedNode form WSAuthorEditorPageBase in hopes that I could parse the children of that node, but I wan't able to make that work.
Any advice will be greatly appreciated.
Thanks,
Jacob
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Evaluate Node Collection of Selection
Hi Jacob,
You could try this API:
ro.sync.ecss.extensions.api.AuthorDocumentController.getNodesToSelect(int, int)
Regards,
Radu
You could try this API:
ro.sync.ecss.extensions.api.AuthorDocumentController.getNodesToSelect(int, int)
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 12
- Joined: Thu May 11, 2017 10:18 pm
Re: Evaluate Node Collection of Selection
Post by jacobBocaj »
Hello Radu,
Thank you for this suggestion. This solution works perfectly.
Regards,
Jacob
Thank you for this suggestion. This solution works perfectly.
Regards,
Jacob
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