当前位置: 首页>>代码示例>>Java>>正文


Java UIDeletionBinding类代码示例

本文整理汇总了Java中uk.org.ponder.rsf.components.UIDeletionBinding的典型用法代码示例。如果您正苦于以下问题:Java UIDeletionBinding类的具体用法?Java UIDeletionBinding怎么用?Java UIDeletionBinding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


UIDeletionBinding类属于uk.org.ponder.rsf.components包,在下文中一共展示了UIDeletionBinding类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillComponents

import uk.org.ponder.rsf.components.UIDeletionBinding; //导入依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewParams, ComponentChecker checker) {
    	
	GroupImportViewParameters params = (GroupImportViewParameters) viewParams;
    	
	UIBranchContainer content = UIBranchContainer.make(tofill, "content:");
	UIVerbatim.make(content, "import1.instr.req.1", messageLocator.getMessage("import1.instr.req.1"));
	UIVerbatim.make(content, "import1.instr.req.2", messageLocator.getMessage("import1.instr.req.2"));
	UIVerbatim.make(content, "import1.instr.req.3", messageLocator.getMessage("import1.instr.req.3"));
	UIForm uploadForm = UIForm.make(content, "uploadform");
	UIInput.make(uploadForm, "groupuploadtextarea", "#{SiteManageGroupSectionRoleHandler.groupUploadTextArea}");
	UICommand.make(uploadForm, "continue", messageLocator.getMessage("import1.continue"), "#{SiteManageGroupSectionRoleHandler.processUploadAndCheck}");
	UICommand cancel = UICommand.make(uploadForm, "cancel", messageLocator.getMessage("cancel"), "#{SiteManageGroupSectionRoleHandler.processCancel}");
	cancel.parameters.add(new UIDeletionBinding("#{destroyScope.resultScope}"));
    
	frameAdjustingProducer.fillComponents(tofill, "resize", "resetFrame");

	//process any messages
	tml = handler.messages;
	if (tml.size() > 0) {
		for (int i = 0; i < tml.size(); i ++ ) {
			UIBranchContainer errorRow = UIBranchContainer.make(tofill,"error-row:", Integer.toString(i));
			TargettedMessage msg = tml.messageAt(i);
			if (msg.args != null )
			{
				UIMessage.make(errorRow,"error", msg.acquireMessageCode(), (Object[]) msg.args);
			}
			else
			{
				UIMessage.make(errorRow,"error", msg.acquireMessageCode());
			}
		}
	}
	    
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:35,代码来源:GroupImportStep1Producer.java

示例2: fill

import uk.org.ponder.rsf.components.UIDeletionBinding; //导入依赖的package包/类
public void fill(UIContainer tofill, ViewParameters viewparams, ComponentChecker checker) {

        SwitchViewParams svp = (SwitchViewParams) viewparams;

        String currentUserId = commonLogic.getCurrentUserId();
        boolean userAdmin = commonLogic.isUserAdmin(currentUserId);

        //top links here
        navBarRenderer.makeNavBar(tofill, NavBarRenderer.NAV_ELEMENT, this.getViewID());

        // ability to control the listing of templates that appear (i.e. enable more than default templates)
        boolean showDefaults = false;
        if (userAdmin) {
            // default to showing the default templates
            if (svp.switcher == null) {
                svp.switcher = DEFAULTS;
            }
            UIBranchContainer switchBranch = UIBranchContainer.make(tofill, "showSwitch:");
            UIInternalLink defaultLink = UIInternalLink.make(switchBranch, "showDefaultsLink",
                    UIMessage.make("controlemailtemplates.show.defaults.link"),
                    new SwitchViewParams(ControlEmailTemplatesProducer.VIEW_ID, DEFAULTS));
            UIInternalLink otherLink = UIInternalLink.make(switchBranch, "showOthersLink", 
                    UIMessage.make("controlemailtemplates.show.others.link"),
                    new SwitchViewParams(ControlEmailTemplatesProducer.VIEW_ID, OTHERS));
            if (svp.switcher.equals(DEFAULTS)) {
                showDefaults = true;
                defaultLink.decorate(CLASS_DECORATOR);
            } else {
                showDefaults = false;
                otherLink.decorate(CLASS_DECORATOR);
            }
        }

        // Get all the email templates for the user
        List<EvalEmailTemplate> templatesList = evaluationService.getEmailTemplatesForUser(currentUserId, null, showDefaults);
        if (templatesList.isEmpty()) {
            UIMessage.make(tofill, "templatesList_none", "controlemailtemplates.no.templates");
        }
        for (int i = 0; i < templatesList.size(); i++) {
            EvalEmailTemplate emailTemplate = templatesList.get(i);

            UIBranchContainer templatesBranch = UIBranchContainer.make(tofill, "templatesList:", i+"");
            UIOutput.make(templatesBranch, "template_number", (i + 1)+"");
            UIOutput.make(templatesBranch, "template_title", emailTemplate.getDefaultType());
            UIMessage.make(templatesBranch, "template_subject", "controlemailtemplates.subject", 
                    new Object[] {emailTemplate.getSubject()});
            UIVerbatim.make(templatesBranch, "template_text", new LineBreakResolver().resolveBean(emailTemplate.getMessage()) );


            boolean canControl = evaluationService.canControlEmailTemplate(currentUserId, null, emailTemplate.getId());
            if ( canControl ) {
                UIInternalLink.make(templatesBranch, "modify_link", 
                        UIMessage.make("general.command.edit"), 
                        new EmailViewParameters(ModifyEmailProducer.VIEW_ID, emailTemplate.getId(), emailTemplate.getType(), null) );
            } else {
                UIMessage.make(templatesBranch, "modify_link_disabled", "general.command.edit");
            }

            if ( canControl && 
                    emailTemplate.getDefaultType() == null ) {
                UIForm form = UIForm.make(templatesBranch, "removeForm");
                UICommand command = UICommand.make(form, "removeCommand");
                command.addParameter( new UIDeletionBinding(EMAIL_TEMPLATE_LOCATOR + emailTemplate.getId()) );
            } else {
                UIMessage.make(templatesBranch, "remove_link_disabled", "general.command.delete");
            }
        }
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:69,代码来源:ControlEmailTemplatesProducer.java


注:本文中的uk.org.ponder.rsf.components.UIDeletionBinding类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。