Is there a way pickup highlighted words?
Post here questions and problems related to oXygen frameworks/document types.
Is there a way pickup highlighted words?
I'm putting together a set of toolbar shortcuts. I want to be able to do this:
Sample text:
"All look your best," Peter warned them; "first impressions are awfully important."
If I highlight the word 'impressions', I want to see this:
"All look your best," Peter warned them; "first <term keyref="impressions">impressions</term> are awfully important."
I have a custom framework where I've used the wrap element, but it's getting the attribute set that I can't seem to figure out. I'm sure I'm just overlooking something simple. But I don't see anything in the documentation either.
Sample text:
"All look your best," Peter warned them; "first impressions are awfully important."
If I highlight the word 'impressions', I want to see this:
"All look your best," Peter warned them; "first <term keyref="impressions">impressions</term> are awfully important."
I have a custom framework where I've used the wrap element, but it's getting the attribute set that I can't seem to figure out. I'm sure I'm just overlooking something simple. But I don't see anything in the documentation either.
Re: Is there a way pickup highlighted words?
Hi Wayne,
What do you mean by "I've used the wrap element"? Can you give me some sample code about how you attempt to do this in the custom framework?
For example if I used the AuthorDocumentController API from the Java code I would do something like:
https://www.oxygenxml.com/InstData/Edit ... oller.html
Regards,
Radu
What do you mean by "I've used the wrap element"? Can you give me some sample code about how you attempt to do this in the custom framework?
For example if I used the AuthorDocumentController API from the Java code I would do something like:
Code: Select all
if(authorAccess.getEditorAccess().hasSelection()){
AuthorDocumentFragment frag = authorAccess.getDocumentController().createNewDocumentFragmentInContext("<term keyref='impressions'/>", authorAccess.getEditorAccess().getCaretOffset());
authorAccess.getDocumentController().surroundInFragment(frag, authorAccess.getEditorAccess().getSelectionStart(), authorAccess.getEditorAccess().getSelectionEnd() - 1);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Is there a way pickup highlighted words?
In the Document Type Association panel, I've added an extension of the DITA framework, in that I've created an action for a custom toolbar item.
I've added the operation of :
ToggleSurroundWithElementOperation
In the Argument Value, it has:
Name: Element
Type: Fragment
It's in this value dialog I was hoping there was something I could do that would enable me to to not only place the <term keyref=""></term>, but actually pickup the word highlighted and place it in the attribute string. Is that possible, or do I need a different approach?
I've added the operation of :
ToggleSurroundWithElementOperation
In the Argument Value, it has:
Name: Element
Type: Fragment
It's in this value dialog I was hoping there was something I could do that would enable me to to not only place the <term keyref=""></term>, but actually pickup the word highlighted and place it in the attribute string. Is that possible, or do I need a different approach?
Re: Is there a way pickup highlighted words?
Here is where I am doing things Radu:
https://www.oxygenxml.com/doc/versions/ ... ialog.html
https://www.oxygenxml.com/doc/versions/ ... ialog.html
Re: Is there a way pickup highlighted words?
Hi,
You can use the ${selection} editor variable in the value you set for the "element" parameter of the operation like:
Regards,
Radu
You can use the ${selection} editor variable in the value you set for the "element" parameter of the operation like:
Code: Select all
<term keyref="${selection}"/>
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