Custom Action for highlight content
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 5
- Joined: Fri Nov 22, 2024 9:59 am
Custom Action for highlight content
Hello,
I'd like the highlight action to be available in the floating toolbar that appears when I select text.
Is there a predefined custom action for highlighting?
*Just for clarification, we have already set up a custom floating toolbar. The only action missing is the ability to highlight content in a desired color, as I can't find the corresponding action for it. Is this possible using the out-of-the-box author actions, or is more advanced customization necessary?
Thank you!
Vincent
I'd like the highlight action to be available in the floating toolbar that appears when I select text.
Is there a predefined custom action for highlighting?
*Just for clarification, we have already set up a custom floating toolbar. The only action missing is the ability to highlight content in a desired color, as I can't find the corresponding action for it. Is this possible using the out-of-the-box author actions, or is more advanced customization necessary?
Thank you!
Vincent
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Custom Action for highlight content
Hi Vincent,
The oxy_button form control that you can add from the CSS on a floating toolbar can only access DITA specific actions like Bold, Italic, etc. And the actions to add highlights with various colors are not accessible to it.
What one could do would be to create custom Java-based AuthorOperations which use our APIs to add higlights of certain colors:
https://www.oxygenxml.com/doc/versions/ ... a-api.html
an operation which inserts a highlight of a certain color over a selection would look like this:
and then create Author actions in your framework, one for each color, each action with an icon which matches the color and calling the custom operation to insert a highlight with that color.
Then in the CSS refer to those Author actions in the floating toolbar. So this would require some customization work.
Regards,
Radu
The oxy_button form control that you can add from the CSS on a floating toolbar can only access DITA specific actions like Bold, Italic, etc. And the actions to add highlights with various colors are not accessible to it.
What one could do would be to create custom Java-based AuthorOperations which use our APIs to add higlights of certain colors:
https://www.oxygenxml.com/doc/versions/ ... a-api.html
an operation which inserts a highlight of a certain color over a selection would look like this:
Code: Select all
/**
* @see ro.sync.ecss.extensions.api.AuthorOperation#doOperation(ro.sync.ecss.extensions.api.AuthorAccess, ro.sync.ecss.extensions.api.ArgumentsMap)
*/
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
throws AuthorOperationException {
AuthorEditorAccess editorAccess = authorAccess.getEditorAccess();
if(editorAccess.hasSelection()) {
AuthorPersistentHighlighter persistentHighlighter = editorAccess.getPersistentHighlighter();
LinkedHashMap<String, String> props = new LinkedHashMap<>();
props.put("type", "oxy_content_highlight");
props.put("color", "255,60,255");
persistentHighlighter.addHighlight(editorAccess.getSelectionStart(),
editorAccess.getSelectionEnd() - 1, props);
}
}
Then in the CSS refer to those Author actions in the floating toolbar. So this would require some customization work.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 5
- Joined: Fri Nov 22, 2024 9:59 am
Re: Custom Action for highlight content
Hello Radu,
so far, we have only used the out-of-the-box author actions to modify our framework.
However, in the future, we also plan to use your SDK. So this will definitely help us - thank you!
Kind regards,
Vincent
so far, we have only used the out-of-the-box author actions to modify our framework.
However, in the future, we also plan to use your SDK. So this will definitely help us - thank you!
Kind regards,
Vincent
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