Get next valid position to insert a fragment
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 47
- Joined: Thu Jun 19, 2014 3:55 pm
Get next valid position to insert a fragment
Hi,
we are using the Eclipse Oxygen Author in Version 15.2.
I am using the
method to insert a fragment. If the exception will be thrown, the method will not insert anything of course.
My question is: How I can get the next possible offset, where the fragment can be dropped?
It would be nice, when I can open the same dialog, which will be shown if the offset is not valid for this fragment.
Best regards
Denis
we are using the Eclipse Oxygen Author in Version 15.2.
I am using the
Code: Select all
try {
documentController.insertFragmentSchemaAware(offset, fragment);
} catch (AuthorOperationException e) {}
method to insert a fragment. If the exception will be thrown, the method will not insert anything of course.
My question is: How I can get the next possible offset, where the fragment can be dropped?
It would be nice, when I can open the same dialog, which will be shown if the offset is not valid for this fragment.
Best regards
Denis
Denis Zygann
KGU Consulting GmbH
http://www.kgu-consulting.com
KGU Consulting GmbH
http://www.kgu-consulting.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Get next valid position to insert a fragment
Hi Denis,
That dialog which shows alternative strategies is not API so you cannot show it from your side.
At the same time you have API to see if a certain fragment can be inserted in a certain place in the Author editing mode:
AuthorDocumentController.getAuthorSchemaManager().canInsertDocumentFragment(AuthorDocumentFragment, int, short)
So you can try at the current offset and if it fails you can try around it, for example try before the current node or after it, or before the parent node and so on. That's about what we do in order to decide what alternate strategies to present to the user.
Regards,
Radu
I do not understand very well what you want to accomplish.It would be nice, when I can open the same dialog, which will be shown if the offset is not valid for this fragment.
That dialog which shows alternative strategies is not API so you cannot show it from your side.
At the same time you have API to see if a certain fragment can be inserted in a certain place in the Author editing mode:
AuthorDocumentController.getAuthorSchemaManager().canInsertDocumentFragment(AuthorDocumentFragment, int, short)
So you can try at the current offset and if it fails you can try around it, for example try before the current node or after it, or before the parent node and so on. That's about what we do in order to decide what alternate strategies to present to the user.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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