Oxygen Web Author 20.1 multiple custom Dialogs
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
-
- Posts: 157
- Joined: Mon Aug 18, 2014 4:11 pm
Oxygen Web Author 20.1 multiple custom Dialogs
Hi team,
We are working on making custom dialogs for Oxygen Web Author 20.1. We have followed the steps in the below link,
https://www.oxygenxml.com/maven/com/oxy ... ction.html
We are able to create the custom dialog and its functionality making use of the references. Also we are able to add an icon to the custom dialog.
Now we would like to add one more action to the toolbar just near the new item (the existing custom dialog is registered as "insert.link"). If we try to give a different name when registering the item, the new item is getting moved to the end in the tool bar.
We have two queries:
1) Is it possible to make use of the existing custom icon to make it work for the new functionality as well. Means, different action dialog should launch based on the context where the cursor is. So in practice, there should be only one new icon in the toolbar for two functionalities. If so, how?
2) If the above is not possible, is it possible to keep the new action just next to "insert.link" action we created? If so, how?
Regards,
Shabeer
We are working on making custom dialogs for Oxygen Web Author 20.1. We have followed the steps in the below link,
https://www.oxygenxml.com/maven/com/oxy ... ction.html
We are able to create the custom dialog and its functionality making use of the references. Also we are able to add an icon to the custom dialog.
Now we would like to add one more action to the toolbar just near the new item (the existing custom dialog is registered as "insert.link"). If we try to give a different name when registering the item, the new item is getting moved to the end in the tool bar.
We have two queries:
1) Is it possible to make use of the existing custom icon to make it work for the new functionality as well. Means, different action dialog should launch based on the context where the cursor is. So in practice, there should be only one new icon in the toolbar for two functionalities. If so, how?
2) If the above is not possible, is it possible to keep the new action just next to "insert.link" action we created? If so, how?
Regards,
Shabeer
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Oxygen Web Author 20.1 multiple custom Dialogs
Post by cristi_talau »
Hello,
1) Regarding an action whose behavior changes depending on the caret position. There are several approaches to implement this functionality:
You can use the splice function to insert the new action at a position of your choice.
Best,
Cristian
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
1) Regarding an action whose behavior changes depending on the caret position. There are several approaches to implement this functionality:
- In JavaScript you have API to get the current selection:
Code: Select all
var selection = editor.getSelectionManager().getSelection();
to check whether it is empty or not [1]and to get the node at caretCode: Select all
selection.isEmpty()
Depending on these checks, you can choose to invoke a different action at the end for example "InsertFragmentOperation" if the selection is empty or "SurroundWithFragmentOperation" if the selection is non-empty.Code: Select all
selection.getNodeAtCaret()
- You can implement your own subclass of AuthorOperation which has a different behavior depending on where the caret is located. In this case you can use the server-side API to implement the required behavior.
Code: Select all
ditaToolbar.children.push(...)
Best,
Cristian
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
-
- Posts: 157
- Joined: Mon Aug 18, 2014 4:11 pm
Re: Oxygen Web Author 20.1 multiple custom Dialogs
Hi,
Thank you for the response and it was useful!
Could you please let me know, if there is an easy way to add tooltip for the newly added item in toolbar.
Regards,
Shabeer
Thank you for the response and it was useful!
Could you please let me know, if there is an easy way to add tooltip for the newly added item in toolbar.
Regards,
Shabeer
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Oxygen Web Author 20.1 multiple custom Dialogs
Post by cristi_talau »
Hello,
When you create your instance of AbstractAction you can override the getDescription() method to provide the text to be included on the tooltip. More details here [1].
Best,
Cristian
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
When you create your instance of AbstractAction you can override the getDescription() method to provide the text to be included on the tooltip. More details here [1].
Best,
Cristian
[1] https://www.oxygenxml.com/maven/com/oxy ... ction.html
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