Skip to main content

How to trigger a plugin by right clicking listed items

Comments

9 comments

  • Richard Moir

    http://assets.geneious.com/developer/geneious/javadoc/latest/overview-summary.html#faqAddMenuBar

    Normally you would create a DocumentOperation and specify setInPopupMenu(true) in getActionOptions().

    0
  • Mark Miller

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

    0
  • Richard Moir

    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);
    0
  • Mark Miller

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

    0
  • Mark Miller

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

    0
  • Richard Moir

    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.

    0
  • Mark Miller

    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?

    0
  • Richard Moir

    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.

    0
  • Mark Miller

    Perfect, thank you.

     

    0

Please sign in to leave a comment.