Post

2 followers Follow
0
Avatar

How to trigger a plugin by right clicking listed items

I am trying write a plugin that is triggered by right clicking listed items and select the option that I will be adding. Is there any documentation on doing that? How should I go about doing this? 
Thank you, 
Mark

 

 

Mark Miller

Please sign in to leave a comment.

9 comments

0
Avatar

I am already using DocumentOperation for a menu bar triggered GUI, is it possible to have both?

Mark Miller 0 votes
Comment actions Permalink
0
Avatar

Yes, you can set both on the same action options and the operation will appear in both places:

actionOptions.setInPopupMenu(true).setMainMenuLocation(GeneiousActionOptions.MainMenu.Tools);
Richard Moir 0 votes
Comment actions Permalink
0
Avatar

I meant that I wanted to have different GUIs for different actions, not triggering the same GUI with different actions.

Mark Miller 0 votes
Comment actions Permalink
0
Avatar

Actually, to be more specific, how can I add a tab to the "Tree..." option, which is shown after right clicking an alignment?

Mark Miller 0 votes
Comment actions Permalink
0
Avatar

Ah ok, in that case you should return two operations from GeneiousPlugin.getDocumentOperations().

To have an operation appear under Tree you have to use the 4 parameter version of the GeneiousActionOptions constructor in your getActionOptions method. You should then pass Category.TreeBuilding as the forth parameter.

Richard Moir 0 votes
Comment actions Permalink
0
Avatar

Thank you very much, it works perfectly. On a side note, i noticed that Geneious has updated to version 9.1.2, but when I run my plugin on eclipse, it launches version 9.0.4, where should I modify so it would be tested on the latest version?

Mark Miller 0 votes
Comment actions Permalink
0
Avatar

The dev kit has a copy of Geneious bundled inside it so to upgrade you have to download the latest dev kit and move your code over.

Richard Moir 0 votes
Comment actions Permalink