// Set the 'effective' author to be Polly.
textView.setAuthor(AdminWavelet.POLLY);
textView.append("\n\n");
textView.appendElement(new FormElement(ElementType.LABEL, TITLE_LABEL,
"Enter the title of your poll here:"));
textView.appendElement(new FormElement(ElementType.INPUT, TITLE_INPUT,
metadata.getTitle()));
textView.append("\n");
textView.appendElement(new FormElement(ElementType.LABEL, QUESTION_LABEL,
"Question: Enter the text of your question here:"));
textView.appendElement(new FormElement(ElementType.INPUT, QUESTION_INPUT,
metadata.getQuestion()));
textView.append("\n");
textView.appendElement(new FormElement(ElementType.LABEL, CHOICES_LABEL,
"Choices:"));
FormElement textArea = new FormElement(ElementType.TEXTAREA, CHOICES_INPUT);
textView.appendElement(textArea);
// Style the textarea to initially be bulleted.
int textAreaPosition = textView.getPosition(textArea);
textView.setStyle(new Range(textAreaPosition, textAreaPosition + 1), StyleType.BULLETED);
textView.append("\n");
textView.appendElement(new FormElement(ElementType.LABEL, RECIPIENTS_LABEL,
"Recipients (comma separated list of participants):"));
textView.appendElement(new FormElement(ElementType.INPUT, RECIPIENTS_INPUT,
metadata.getRecipients()));
textView.append("\n");
textView.appendElement(new FormElement(ElementType.BUTTON, DISTRIBUTE_POLL_BUTTON,
"Distribute Poll"));
// Create an annotation over the document so that we can recognize it. No
// value is set since we are only concerned with the existence of the
// annotation.