DocumentSelectionOption example
Hi,
Context:
I am creating a custom options dialog box. I want to incorporate "add Documents to workflow" like option to the dialog box.
Question:
Is addDocumentSelectionOption the right method? Can someone provide an example of how to use DocumentSelectionOption?
Thanks!
0
-
Yes, addDocumentSelectionOption is a good way to do it.
Here's and example using it to specify one additional sequence document:
//add the option
List<DocumentField> fieldsToDisplay = Arrays.asList(DocumentField.DESCRIPTION_FIELD, DocumentField.SEQUENCE_LENGTH);
DocumentSelectionOption documentSelectionOption = options.addDocumentSelectionOption("additionalSequence", "Addition Sequence:", DocumentSelectionOption.FolderOrDocuments.EMPTY,
DocumentType.NUCLEOTIDE_SEQUENCE_TYPE, fieldsToDisplay, false, Collections.emptyList());
//get its value
AnnotatedPluginDocument additionalDocument = documentSelectionOption.getDocuments().get(0);0 -
Thank you! This answered my question.
0 -
With the code block above, I receive a NullPointerException with the null default value parameter. How would I resolve this?
(I want to reproduce below)
0 -
Sorry about that, you can use the following for an empty selection instead of null:
DocumentSelectionOption.FolderOrDocuments.EMPTY
0 -
Thank you! This answered my question.
0
Please sign in to leave a comment.
Comments
5 comments