DynamicForm form = new DynamicForm();
form.setTitleOrientation(TitleOrientation.TOP);
form.setWidth(500);
SectionItem repoSection = new SectionItem("repoSection");
repoSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_repository());
repoSection.setWidth("100%");
SectionItem packageSection = new SectionItem("packageSection");
packageSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_script());
SectionItem userSection = new SectionItem("userSection");
userSection.setDefaultValue(MSG.view_alert_definition_notification_cliScript_editor_whichUser());
repoSelector = new SortedSelectItem("repoSelector",
MSG.view_alert_definition_notification_cliScript_editor_selectRepo());
repoSelector.setDefaultToFirstOption(true);
repoSelector.setWrapTitle(false);
repoSelector.setWidth(400);
repoSelector.setValueMap(MSG.common_msg_loading());
repoSelector.setDisabled(true);
LinkedHashMap<String, DynamicForm> packageSelectItems = new LinkedHashMap<String, DynamicForm>();
packageSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_existingScript(),
createExistingPackageForm());
packageSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_uploadNewScript(),
createUploadNewScriptForm());
packageSelector = new RadioGroupWithComponentsItem("packageSelector", "", packageSelectItems, form);
packageSelector.setWidth("100%");
LinkedHashMap<String, DynamicForm> userSelectItems = new LinkedHashMap<String, DynamicForm>();
userSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_thisUser(), null);
userSelectItems.put(MSG.view_alert_definition_notification_cliScript_editor_anotherUser(),
createAnotherUserForm());
userSelector = new RadioGroupWithComponentsItem("userSelector", "", userSelectItems, form);
userSelector.setWidth("100%");
userSelector.setShowTitle(false);
repoSection.setItemIds("repoSelector");
packageSection.setItemIds("packageSelector");
userSection.setItemIds("userSelector");
form.setFields(userSection, userSelector, repoSection, repoSelector, packageSection,
packageSelector);
addMember(form);