本文整理汇总了Java中uk.org.ponder.rsf.components.UIForm类的典型用法代码示例。如果您正苦于以下问题:Java UIForm类的具体用法?Java UIForm怎么用?Java UIForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIForm类属于uk.org.ponder.rsf.components包,在下文中一共展示了UIForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateSettingsControlledCheckbox
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
/**
* Generate a checkbox which is controlled by a system boolean setting,
* if setting is configurable (null) then show the checkbox, else disable the checkbox<br/>
* <b>NOTE:</b> the label for this checkbox must use an rsf:id of (rsfId + "_label")<br/>
* <b>NOTE:</b> the message key for the label must be ("evalsettings." + rsfId + ".label")
*
* @param parent the parent container
* @param rsfId the rsf id of the checkbox
* @param binding the EL binding for this control value
* @param systemSetting the system setting value which controls this checkbox
* @param form the form which the control is part of
* @param disabled if true then disable the control, else it is enabled (for disabling based on state)
*/
protected void generateSettingsControlledCheckbox(UIContainer parent, String rsfId,
String binding, Boolean systemSetting, UIForm form, boolean disabled) {
if (systemSetting == null) {
UIBoundBoolean checkbox = UIBoundBoolean.make(parent, rsfId, binding);
UIMessage.make(parent, rsfId + "_label", "evalsettings." + rsfId + ".label");
if (disabled) {
RSFUtils.disableComponent(checkbox); // disable the control
}
} else {
// bind the value explicitly
form.parameters.add(new UIELBinding(binding, systemSetting));
// now render the appropriate messages
if (systemSetting) {
UIMessage.make(parent, rsfId + "_label", "evalsettings." + rsfId + ".label");
} else {
UIMessage.make(parent, rsfId + "_label", "evalsettings." + rsfId + ".disabled");
}
}
}
示例2: fill
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
/**
* @see org.sakaiproject.evaluation.tool.producers.EvalCommonProducer#fill(uk.org.ponder.rsf.components.UIContainer,
* uk.org.ponder.rsf.viewstate.ViewParameters, uk.org.ponder.rsf.view.ComponentChecker)
*/
@Override
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
boolean userAdmin = commonLogic.isUserAdmin(commonLogic.getCurrentUserId());
if (!userAdmin) {
throw new SecurityException("Non-admin users may not access this page");
}
navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());
UIForm uploadform = UIForm.make(tofill, "upload-form");
UICommand.make(uploadform, "upload-button", UIMessage.make("importconfig.upload.button"), "propertiesFileParser.parse");
setCurrentSettingsForDisplay(tofill);
// Only add the commit button if the user has uploaded settings.
if (!uploadedConfigValues.keySet().isEmpty()) {
UIForm overwriteForm = UIForm.make(tofill, "overwrite-form");
UICommand.make(overwriteForm, "overwrite-button", UIMessage.make("importconfig.overwrite.config.button"), "overwriteSettingsHandler.saveOverwriteSettings");
}
// Clean the uploaded settings out
uploadedConfigValues = new HashMap<>();
}
示例3: createTwitterDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createTwitterDialog(UIContainer tofill, SimplePage currentPage) {
UIOutput.make(tofill, "add-twitter-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.twitter")));
UIForm form = UIForm.make(tofill, "add-twitter-form");
makeCsrf(form, "csrf13");
UIInput.make(form, "twitterEditId", "#{simplePageBean.itemId}");
UIInput.make(form, "twitter-addBefore", "#{simplePageBean.addBefore}");
UIInput.make(form, "twitter-username", "#{simplePageBean.twitterUsername}");
UIOutput.make(form, "twitter-username-label", messageLocator.getMessage("simplepage.twitter-username"));
UIInput.make(form, "widget-height", "#{simplePageBean.twitterWidgetHeight}");
UIOutput.make(form, "height-label", messageLocator.getMessage("simplepage.twitter.height_label"));
//Adding default values for tweet number dropdown
String[] options = {"5","10","25","50","100","1000"};
String[] labels = {"5","10","25","50","100","1000"};
UIOutput.make(form, "numberDropdownLabel", messageLocator.getMessage("simplepage.number-dropdown-label"));
UISelect.make(form, "numberDropdown", options, labels, "#{simplePageBean.twitterDropDown}","5");
UICommand.make(form, "twitter-add-item", messageLocator.getMessage("simplepage.save_message"), "#{simplePageBean.addTwitterTimeline}");
UICommand.make(form, "twitter-cancel", messageLocator.getMessage("simplepage.cancel"), null);
UICommand.make(form, "delete-twitter-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteItem}");
}
示例4: createForumSummaryDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createForumSummaryDialog(UIContainer tofill, SimplePage currentPage) {
UIOutput.make(tofill, "add-forum-summary-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.forumSummaryLinkText")));
UIForm form = UIForm.make(tofill, "add-forum-summary-form");
makeCsrf(form, "csrf24");
//check if site has forum tool added?if not then display info and return
if (simplePageBean.getCurrentTool(simplePageBean.FORUMS_TOOL_ID) == null) {
UIOutput.make(tofill, "forum-summary-error-div");
UIOutput.make(tofill, "forum-summary-error-span", messageLocator.getMessage("simplepage.no_forum_tools"));
UICommand.make(form, "forum-summary-cancel", messageLocator.getMessage("simplepage.cancel"), null);
return;
}
UIInput.make(form, "forumSummaryEditId", "#{simplePageBean.itemId}");
String[] options = {"5", "10", "15", "20", "30", "50"};
String[] labels = {"5", "10", "15", "20", "30", "50"};
UIOutput.make(form, "forumNumberDropdownLabel", messageLocator.getMessage("simplepage.forum-number-dropdown-label"));
UISelect.make(form, "forumNumberDropdown", options, labels, "#{simplePageBean.forumSummaryDropDown}", "5");
UICommand.make(form, "forum-summary-add-item", messageLocator.getMessage("simplepage.save_message"), "#{simplePageBean.addForumSummary}");
UIInput.make(form, "forum-summary-add-before", "#{simplePageBean.addBefore}");
UICommand.make(form, "forum-summary-cancel", messageLocator.getMessage("simplepage.cancel"), null);
UICommand.make(form, "delete-forum-summary-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteItem}");
}
示例5: createSubpageDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createSubpageDialog(UIContainer tofill, SimplePage currentPage) {
UIOutput.make(tofill, "subpage-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.subpage")));
UIForm form = UIForm.make(tofill, "subpage-form");
makeCsrf(form, "csrf7");
UIOutput.make(form, "subpage-label", messageLocator.getMessage("simplepage.pageTitle_label"));
UIInput.make(form, "subpage-title", "#{simplePageBean.subpageTitle}");
GeneralViewParameters view = new GeneralViewParameters(PagePickerProducer.VIEW_ID);
view.setSendingPage(currentPage.getPageId());
if(!simplePageBean.isStudentPage(currentPage)) {
UIInternalLink.make(form, "subpage-choose", messageLocator.getMessage("simplepage.choose_existing_page"), view);
}
UIBoundBoolean.make(form, "subpage-next", "#{simplePageBean.subpageNext}", false);
UIBoundBoolean.make(form, "subpage-button", "#{simplePageBean.subpageButton}", false);
UIInput.make(form, "subpage-add-before", "#{simplePageBean.addBefore}");
UICommand.make(form, "create-subpage", messageLocator.getMessage("simplepage.create"), "#{simplePageBean.createSubpage}");
UICommand.make(form, "cancel-subpage", messageLocator.getMessage("simplepage.cancel"), null);
}
示例6: createAnnouncementsDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createAnnouncementsDialog(UIContainer tofill, SimplePage currentPage){
UIOutput.make(tofill, "add-announcements-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.announcementsLinkText")));
UIForm form = UIForm.make(tofill, "add-announcements-form");
makeCsrf(form, "csrf23");
//check if site has announcements tool added?if not then display info and return
if(simplePageBean.getCurrentTool(simplePageBean.ANNOUNCEMENTS_TOOL_ID) == null){
UIOutput.make(tofill, "announcements-error-div");
UIOutput.make(tofill, "announcements-error-span", messageLocator.getMessage("simplepage.no_announcements_tool"));
UICommand.make(form, "announcements-cancel", messageLocator.getMessage("simplepage.cancel"), null);
UICommand.make(form, "delete-announcements-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteItem}");
return;
}
UIInput.make(form, "announcementsEditId", "#{simplePageBean.itemId}");
String[] options = {"5","10","15","20","30","50"};
String[] labels = {"5","10","15","20","30","50"};
UIOutput.make(form, "announcementsNumberDropdownLabel", messageLocator.getMessage("simplepage.announcements-number-dropdown-label"));
UISelect.make(form, "announcementsNumberDropdown", options, labels, "#{simplePageBean.announcementsDropdown}","5");
UICommand.make(form, "announcements-add-item", messageLocator.getMessage("simplepage.save_message"), "#{simplePageBean.addAnnouncements}");
UIInput.make(form, "announcements-add-before", "#{simplePageBean.addBefore}");
UICommand.make(form, "announcements-cancel", messageLocator.getMessage("simplepage.cancel"), null);
UICommand.make(form, "delete-announcements-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteItem}");
}
示例7: createExportCcDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createExportCcDialog(UIContainer tofill) {
UIOutput.make(tofill, "export-cc-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.export-cc-title")));
UIForm form = UIForm.make(tofill, "export-cc-form");
UIOutput.make(form, "export-cc-v11"); // value is handled by JS, so RSF doesn't need to treat it as input
UIOutput.make(form, "export-cc-v13"); // value is handled by JS, so RSF doesn't need to treat it as input
UIOutput.make(form, "export-cc-bank"); // value is handled by JS, so RSF doesn't need to treat it as input
UICommand.make(form, "export-cc-submit", messageLocator.getMessage("simplepage.exportcc-download"), "#{simplePageBean.importCc}");
UICommand.make(form, "export-cc-cancel", messageLocator.getMessage("simplepage.cancel"), null);
// the actual submission is with a GET. The submit button clicks this link.
ExportCCViewParameters view = new ExportCCViewParameters("exportCc");
view.setExportcc(true);
view.setVersion("1.2");
view.setBank("1");
UIInternalLink.make(form, "export-cc-link", "export cc link", view);
}
示例8: createYoutubeDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createYoutubeDialog(UIContainer tofill, SimplePage currentPage) {
UIOutput.make(tofill, "youtube-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.edit_youtubelink")));
UIForm form = UIForm.make(tofill, "youtube-form");
makeCsrf(form, "csrf17");
UIInput.make(form, "youtubeURL", "#{simplePageBean.youtubeURL}");
UIInput.make(form, "youtubeEditId", "#{simplePageBean.youtubeId}");
UIInput.make(form, "youtubeHeight", "#{simplePageBean.height}");
UIInput.make(form, "youtubeWidth", "#{simplePageBean.width}");
UIOutput.make(form, "description4-label", messageLocator.getMessage("simplepage.description_label"));
UIInput.make(form, "description4", "#{simplePageBean.description}");
UICommand.make(form, "delete-youtube-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteYoutubeItem}");
UICommand.make(form, "update-youtube", messageLocator.getMessage("simplepage.edit"), "#{simplePageBean.updateYoutube}");
UICommand.make(form, "cancel-youtube", messageLocator.getMessage("simplepage.cancel"), null);
UIBoundBoolean.make(form, "youtube-prerequisite", "#{simplePageBean.prerequisite}",false);
if(!simplePageBean.isStudentPage(currentPage)) {
UIOutput.make(form, "editgroups-youtube");
}
}
示例9: createNewPageDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createNewPageDialog(UIContainer tofill, SimplePage page, SimplePageItem pageItem) {
UIOutput.make(tofill, "new-page-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.new-page")));
UIForm form = UIForm.make(tofill, "new-page-form");
makeCsrf(form, "csrf15");
UIInput.make(form, "newPage", "#{simplePageBean.newPageTitle}");
UIInput.make(form, "new-page-number", "#{simplePageBean.numberOfPages}");
UIBoundBoolean.make(form, "new-page-copy", "#{simplePageBean.copyPage}", false);
GeneralViewParameters view = new GeneralViewParameters(PagePickerProducer.VIEW_ID);
view.setSendingPage(-1L);
view.newTopLevel = true;
UIInternalLink.make(tofill, "new-page-choose", messageLocator.getMessage("simplepage.lm_existing_page"), view);
UICommand.make(form, "new-page-submit", messageLocator.getMessage("simplepage.save"), "#{simplePageBean.addPages}");
UICommand.make(form, "new-page-cancel", messageLocator.getMessage("simplepage.cancel"), "#{simplePageBean.cancel}");
}
示例10: createCommentsDialog
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void createCommentsDialog(UIContainer tofill) {
UIOutput.make(tofill, "comments-dialog").decorate(new UIFreeAttributeDecorator("title", messageLocator.getMessage("simplepage.edit_commentslink")));
UIForm form = UIForm.make(tofill, "comments-form");
makeCsrf(form, "csrf19");
UIInput.make(form, "commentsEditId", "#{simplePageBean.itemId}");
UIBoundBoolean.make(form, "comments-anonymous", "#{simplePageBean.anonymous}");
UIBoundBoolean.make(form, "comments-graded", "#{simplePageBean.graded}");
UIInput.make(form, "comments-max", "#{simplePageBean.maxPoints}");
UIBoundBoolean.make(form, "comments-required", "#{simplePageBean.required}");
UIBoundBoolean.make(form, "comments-prerequisite", "#{simplePageBean.prerequisite}");
UICommand.make(form, "delete-comments-item", messageLocator.getMessage("simplepage.delete"), "#{simplePageBean.deleteItem}");
UICommand.make(form, "update-comments", messageLocator.getMessage("simplepage.edit"), "#{simplePageBean.updateComments}");
UICommand.make(form, "cancel-comments", messageLocator.getMessage("simplepage.cancel"), null);
}
示例11: makeSaveChecklistForm
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
private void makeSaveChecklistForm(UIContainer tofill) {
// Ajax grading form so faculty can grade comments
if(!saveChecklistFormNeeded) {
UIForm saveChecklistForm = UIForm.make(tofill, "saveChecklistForm");
saveChecklistForm.viewparams = new SimpleViewParameters(UVBProducer.VIEW_ID);
UIInput checklistIdInput = UIInput.make(saveChecklistForm, "saveChecklistForm-checklistId", "checklistBean.checklistId");
UIInput checklistItemIdInput = UIInput.make(saveChecklistForm, "saveChecklistForm-checklistItemIdInput", "checklistBean.checklistItemId");
UIInput checklistItemDone = UIInput.make(saveChecklistForm, "saveChecklistForm-checklistItemDone", "checklistBean.checklistItemDone");
Object sessionToken = SessionManager.getCurrentSession().getAttribute("sakai.csrf.token");
String sessionTokenString = null;
if (sessionToken != null)
sessionTokenString = sessionToken.toString();
UIInput checklistCsrfInput = UIInput.make(saveChecklistForm, "saveChecklistForm-csrf", "checklistBean.csrfToken", sessionTokenString);
UIInitBlock.make(tofill, "saveChecklistForm-init", "checklistDisplay.initSaveChecklistForm", new Object[] {checklistIdInput, checklistItemIdInput, checklistItemDone, checklistCsrfInput, "checklistBean.results"});
saveChecklistFormNeeded = true;
}
}
示例12: fillComponents
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams,
ComponentChecker arg2) {
log.debug("fillComponents()");
VoteCollectionViewParameters params = (VoteCollectionViewParameters) viewparams;
String voteId;
if (params.id != null)
voteId = params.id;
else
voteId="VoteId is missing!";
String locale = localeGetter.get().toString();
Map<String, String> langMap = new HashMap<String, String>();
langMap.put("lang", locale);
langMap.put("xml:lang", locale);
UIOutput.make(tofill, "polls-html", null).decorate(new UIFreeAttributeDecorator(langMap));
UIOutput.make(tofill,"confirm-msg",messageLocator.getMessage("thanks_msg"));
UIOutput.make(tofill,"confirm-ref-msg",messageLocator.getMessage("thanks_ref"));
UIOutput.make(tofill,"ref-number",voteId);
UIForm form = UIForm.make(tofill,"back", new SimpleViewParameters(PollToolProducer.VIEW_ID));
UICommand.make(form,"cancel",messageLocator.getMessage("thanks_done"),"#{pollToolBean.cancel}");
}
示例13: fill
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
String beanBinding = "expertItemsBean.";
String actionBinding = "removeExpertItem";
// passed in values
ModifyExpertItemParameters params = (ModifyExpertItemParameters) viewparams;
Long eigId;
if ( EvalConstants.ITEM_GROUP_TYPE_CATEGORY.equals(params.type)) {
eigId = params.categoryId;
} else {
eigId = params.objectiveId;
}
EvalItemGroup eig = authoringService.getItemGroupById(eigId);
// deletion message
UIMessage.make(tofill, "removeexpertitem.confirm.text",
"removeexpertitem.confirm.text", new Object[] {eig.getTitle()});
UIForm form = UIForm.make(tofill, "remove-expertitem-form");
UICommand deleteCommand = UICommand.make(form, "remove-expertitem-remove-button",
UIMessage.make("removeexpertitem.remove.scale.button"), beanBinding + actionBinding);
deleteCommand.parameters.add(new UIELBinding(beanBinding + "eigId", eigId));
UIInternalLink.make(form, "cancel-link", UIMessage.make("modifyexpertitem.cancel"), new SimpleViewParameters(ControlExpertItemsProducer.VIEW_ID));
}
示例14: fillComponents
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
String currentUserId = commonLogic.getCurrentUserId();
String actionBean = "templateBBean.";
UIMessage.make(tofill, "chown-template-title", "chowntemplate.page.title");
UIMessage.make(tofill, "control-panel-title","modifytemplate.page.title");
navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());
TemplateViewParameters evalViewParams = (TemplateViewParameters) viewparams;
if (evalViewParams.templateId != null) {
EvalTemplate template = authoringService.getTemplateById(evalViewParams.templateId);
if (authoringService.canModifyTemplate(currentUserId, template.getId())) {
// Can remove template
UIBranchContainer chownDiv = UIBranchContainer.make(tofill,"chownDiv:");
UIMessage.make(chownDiv, "chown-template-confirm-text", "chowntemplate.confirm.text", new Object[] {template.getTitle()});
UIMessage.make(tofill, "cancel-command-link", "general.cancel.button");
UIForm form = UIForm.make(chownDiv, "chown-template-form");
UIMessage.make(form, "chown-template-newownerlabel", "chowntemplate.chown.label");
UIInput.make(form, "chown-template-newowner", (actionBean + "templateOwner"));
UICommand chownCmd = UICommand.make(form, "chown-template-button",
UIMessage.make("chowntemplate.chown.button"), actionBean + "chownTemplate");
chownCmd.parameters.add(new UIELBinding(actionBean + "templateId", template.getId().toString()));
} else {
// cannot remove for some reason
UIMessage.make(tofill, "cannot-chown-message", "chowntemplate.nochown.text", new Object[] {template.getTitle()});
}
} else {
throw new IllegalArgumentException("templateId must be set for this view");
}
}
示例15: fill
import uk.org.ponder.rsf.components.UIForm; //导入依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {
String currentUserId = commonLogic.getCurrentUserId();
String actionBean = "templateBBean.";
UIMessage.make(tofill, "remove-template-title", "removetemplate.page.title");
UIMessage.make(tofill, "control-panel-title","modifytemplate.page.title");
navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());
TemplateViewParameters evalViewParams = (TemplateViewParameters) viewparams;
if (evalViewParams.templateId != null) {
EvalTemplate template = authoringService.getTemplateById(evalViewParams.templateId);
if (authoringService.canRemoveTemplate(currentUserId, template.getId())) {
// Can remove template
UIBranchContainer removeDiv = UIBranchContainer.make(tofill,"removeDiv:");
UIMessage.make(removeDiv, "remove-template-confirm-text", "removetemplate.confirm.text", new Object[] {template.getTitle()});
UIMessage.make(tofill, "cancel-command-link", "general.cancel.button");
UIForm form = UIForm.make(removeDiv, "remove-template-form");
UICommand removeCmd = UICommand.make(form, "remove-template-button",
UIMessage.make("removetemplate.remove.button"), actionBean + "removeTemplate");
removeCmd.parameters.add(new UIELBinding(actionBean + "templateId", template.getId().toString()));
} else {
// cannot remove for some reason
UIMessage.make(tofill, "cannot-remove-message", "removetemplate.noremove.text", new Object[] {template.getTitle()});
}
} else {
throw new IllegalArgumentException("templateId must be set for this view");
}
}