Page 1 of 1

context menu in Oxygen Author?

Posted: Mon Feb 22, 2016 7:40 am
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

Re: context menu in Oxygen Author?

Posted: Mon Feb 22, 2016 9:33 am
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