Skip to main content

DocumentSelectionOption example

Comments

5 comments

  • Richard Moir

    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
  • Matthew Shum

    Thank you! This answered my question.

    0
  • Matthew Shum

    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
  • Richard Moir

    Sorry about that, you can use the following for an empty selection instead of null:

    DocumentSelectionOption.FolderOrDocuments.EMPTY
    0
  • Matthew Shum

    Thank you! This answered my question.

    0

Please sign in to leave a comment.