Change custom action name depending on some event
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 17
- Joined: Fri Dec 29, 2017 11:16 am
Change custom action name depending on some event
Post by pramanikhimangshu »
Hi,
I have a custom action dita framework to create a link and it modifies the link if selection is already link.
I want to change the display name of the action in context menu. In normal case it will display "Link..." and when the selection is already a link it should display "Modify Link..." in the context menu.
Any help how to do this..
Thanks.
Regards,
Himangshu
I have a custom action dita framework to create a link and it modifies the link if selection is already link.
I want to change the display name of the action in context menu. In normal case it will display "Link..." and when the selection is already a link it should display "Modify Link..." in the context menu.
Any help how to do this..
Thanks.
Regards,
Himangshu
-
- Posts: 417
- Joined: Mon May 09, 2016 9:37 am
Re: Change custom action name depending on some event
Post by sorin_carbunaru »
Hello Himangshu,
Unfortunately, changing the action's name based on the context is not possible. But I thought about a workaround that might interest you...
Instead of having one action that does 2 different things, you could have 2 separate actions, with their own names (let's say "Insert Link" and "Edit Link") and their own activation XPath expressions. The XPath expressions must be written in such a way that these 2 action will never be both active at the same time. And when one of them is not active, it won't even be rendered in the contextual menu. So, if you have both actions next to each other in the contextual menu, but only one of them is rendered at a given time, then for the user it will look like there is only one action that changes its name when the position in the document is changed.
Regards,
Sorin Carbunaru
oXygen XML
Unfortunately, changing the action's name based on the context is not possible. But I thought about a workaround that might interest you...
Instead of having one action that does 2 different things, you could have 2 separate actions, with their own names (let's say "Insert Link" and "Edit Link") and their own activation XPath expressions. The XPath expressions must be written in such a way that these 2 action will never be both active at the same time. And when one of them is not active, it won't even be rendered in the contextual menu. So, if you have both actions next to each other in the contextual menu, but only one of them is rendered at a given time, then for the user it will look like there is only one action that changes its name when the position in the document is changed.
Regards,
Sorin Carbunaru
oXygen XML
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