Show message dialog before options are displayed
Hi,
I am writing a `SequenceAnnotationGenerator` and would like to require that a sequence range be selected before displaying the `Options` dialog.
I am currently able to do this check within `generateAnnotations()`, which has access to the `SelectionRange`, but by the time this is called the user has already completed the `Options` dialog. I would like the check to come before the options, display a message and then return the user to the sequence viewer to select some sequence.
Thanks!
-Pam
-
Official comment
Hi Pam,
If you are creating a SequenceAnnotationGenerator then you should be overriding a getOptions() method in order to create your options. There is a method of getOptions which has a SelectionRange passed into it so I would recommend checking if the selectionRange is null as the first thing to do when you override that method.
For example something like this:@Override
public Options getOptions(AnnotatedPluginDocument[] documents, SelectionRange selectionRange) throws DocumentOperationException {
if (selectionRange == null){
throw new DocumentOperationException("You must select a selection range");
}
...
...
}Let us know if that works out for you!
Cheers,
Tom -
This works! Thanks Tom!
0
Please sign in to leave a comment.
Comments
2 comments