context menu in Oxygen Author?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
nileshp
Posts: 1
Joined: Mon Feb 22, 2016 7:32 am

context menu in Oxygen Author?

Post by nileshp »

I'm playing around with a few plugins and as per the documentation the way to invoke a plugin is through the contextual menu. That is the authors are supposed to right-click on the text > plugins. But I don't see this option in Oxygen Author. I've checked this on both 16 and 17.

Am I missing something?

Thanks,
Nilesh
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: context menu in Oxygen Author?

Post by Radu »

Hi Nilesh,

Some particular types of plugin only works in the Text editing mode (right click, Plugins submenu).
If you want a plugin which is able to add a contextual menu to the Author editing mode, you should try a Workspace Access plugin type:
https://www.oxygenxml.com/doc/versions/ ... lugin.html

Our Plugins SDK should have some Java samples with a Workspace Access plugin implementation.
Something like:

Code: Select all

        @Override
public void applicationStarted(final StandalonePluginWorkspace pluginWorkspaceAccess) {
pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener(){
@Override
public void editorOpened(URL editorLocation) {
WSEditor editorAccess = pluginWorkspaceAccess.getEditorAccess(editorLocation, PluginWorkspace.MAIN_EDITING_AREA)
WSEditorPage edPage = editorAccess.getCurrentPage();
if(edPage instanceof WSAuthorEditorPage){
((WSAuthorEditorPage)edPage).addPopUpMenuCustomizer(new AuthorPopupMenuCustomizer() {

@Override
public void customizePopUpMenu(Object popUp, AuthorAccess authorAccess) {
JPopupMenu menu = (JPopupMenu)popUp;
//And modify the menu here...
}
});
}
}
}, PluginWorkspace.MAIN_EDITING_AREA);
}
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply