Post

2 followers Follow
0
Avatar

Creating submenus does not work in SequenceAnnotationGenerator

class myplugin extends GeneiousPlugin{

public static final GeneiousActionOptions p=new GeneiousActionOptions("name","description").setMainMenuLocation(MainMenu.Tools);

}

class mygenerator extends SequenceAnnotationGenerator{

public GeneiousActionOptions getActionOptions() { return GeneiousActionOptions.createSubmenuActionOptions(myplugin.p, new GeneiousActionOptions(...));}

}

It will create an item "name" under "Tools", but the item is always disabled.

But the same method in my DocumentOperation to create submenus works.

Is there anything wrong?

 

Weixi Liao

Please sign in to leave a comment.

5 comments

0
Avatar

Firstly, are you sure that you have selected some documents in Geneious which match the DocumentSelectionSignature from your SequenceAnnotationGenerator.getSelectionSignatures()?

Richard Moir 0 votes
Comment actions Permalink
0
Avatar

Yes. If I do not use the submenu and directly create an item under "Tools", it is enabled.

Weixi Liao 0 votes
Comment actions Permalink
0
Avatar

That appears to be a bug in the API. I found a slightly ugly workaround though: add a divider to your submenu like this:

public static final GeneiousActionOptions p=new GeneiousActionOptions("name","description").setMainMenuLocation(MainMenu.Tools).addSubmenuDivider(0.6);

Richard Moir 0 votes
Comment actions Permalink
0
Avatar

It will also be fixed if you have another DocumentOperation in the same menu.

Richard Moir 0 votes
Comment actions Permalink