Page 1 of 1

Add tabs/panes to the right panel in Oxygen Web Author

Posted: Tue Jul 05, 2022 10:21 pm
by shreya
In Oxygen Web Author, can we add additional tabs along with separate functionality to those tabs in the right panel ?

Re: Add tabs/panes to the right panel in Oxygen Web Author

Posted: Wed Jul 06, 2022 1:05 pm
by mihaela
Hello,

Yes, you can create a plugin that uses the JavaScript API to add a custom view in Web Author.

Here is a tutorial about customizing side views:
https://www.oxygenxml.com/maven/com/oxy ... mview.html

This is the link to the JavaScript API documentation:
https://www.oxygenxml.com/maven/com/oxy ... index.html

And here is a sample plugin that contributes an 'Elements' view In Web Author:
https://github.com/oxygenxml/web-author ... ments-view

Best Regards,
Mihaela

Re: Add tabs/panes to the right panel in Oxygen Web Author

Posted: Tue Jul 12, 2022 5:17 pm
by shreya
Is there any way to add functionality to the side panel based on caret position or a specific tag position? How can we fetch any selected element, tag or position to create a contextual functionality?

Re: Add tabs/panes to the right panel in Oxygen Web Author

Posted: Wed Jul 13, 2022 7:21 am
by mihaela
Hi,

The ViewRenderer has an editorChanged(editor) callback, received when the focused editor is changed.
You can use sync.api.Editor#getSelectionManager method to obtain the SelectionManager.
Then listen on its SELECTION_CHANGED event to update the view according to the current selection.

Best Regards,
Mihaela

Re: Add tabs/panes to the right panel in Oxygen Web Author

Posted: Wed Jul 13, 2022 10:02 am
by mihaela
Hi,

The following sample plugin creates a custom view that presents the elements that can be inserted at the caret position. It uses the API that I mentioned in my previous post, so you ca use it as an example:
https://github.com/oxygenxml/web-author ... ments-view

Best Regards,
Mihaela