Author mode - custom action - insert fragment before caret
Oxygen general issues.
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Author mode - custom action - insert fragment before caret
Hello,
I've tried to make custom action for inserting non-breaking space entity in my DocBook document. I've used default ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation with attribute 'fragment' set to ' '. It places entity, but after caret, not before it. This method offers three placement values, but only if XPath is specified. Can this be used somehow or do I have to write my own plugin? What I need is placing entity before caret so writing can continue without extra cursor moving step.
Jan
I've tried to make custom action for inserting non-breaking space entity in my DocBook document. I've used default ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation with attribute 'fragment' set to ' '. It places entity, but after caret, not before it. This method offers three placement values, but only if XPath is specified. Can this be used somehow or do I have to write my own plugin? What I need is placing entity before caret so writing can continue without extra cursor moving step.
Jan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - custom action - insert fragment before caret
Post by sorin_ristache »
The fragment is inserted at the cursor location. What value did you set for the insertPosition parameter?
Regards,
Sorin
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - custom action - insert fragment before caret
insertLocation as well as insertPosition are empty. I've also tried insertPosition set to Before, but as it is written in note:
'If the XPath expression is not defined this argument is ignored'.
To tell the truth, it is not very clear if by XPath it is meant insetLocation value or XPath Expression (When this XPath expression is true) from textbox above. Anyway, both are empty in my case.
'If the XPath expression is not defined this argument is ignored'.
To tell the truth, it is not very clear if by XPath it is meant insetLocation value or XPath Expression (When this XPath expression is true) from textbox above. Anyway, both are empty in my case.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - custom action - insert fragment before caret
Post by sorin_ristache »
It is about the insertLocation parameter. If there is no XPath expression set in insertLocation then an insert position relative to a node specified as insert location does not make sense.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - custom action - insert fragment before caret
Thanks, so back to my original question, is there any settings which could be used to insert my fragment ' ' before caret? If XPath is necessary, how to construct it for position somewhere in text? I think self::text() is not sufficient (Oxygen complains 'self::text()' has no result).
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - custom action - insert fragment before caret
Post by sorin_ristache »
The action for inserting a fragment of text in the Author document just inserts the fragment at the cursor location, that is the cursor is replaced with the inserted fragment and after that the cursor is placed at the end of the fragment. What do you mean before caret? Can you give an example?
Regards,
Sorin
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - custom action - insert fragment before caret
Ok, one image is better than hundreds of words:


If fragment is inserted, cursor (caret) is placed into entity, not after fragment, just before Euro sign in this case.


If fragment is inserted, cursor (caret) is placed into entity, not after fragment, just before Euro sign in this case.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - custom action - insert fragment before caret
Post by sorin_ristache »
The default action InsertFragmentOperation places the cursor between the two markers. If you want to place the cursor after the markers you can create your own version of InsertFragmentOperation by modifying the original one included in Author SDK and adding a call authorAccess.getEditorAccess().setCaretPosition(). You find the current position with authorAccess.getEditorAccess().getCaretPosition().
Regards,
Sorin
Regards,
Sorin
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