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


Java UIBranchContainer类代码示例

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


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

示例1: renderCommentBlock

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Render the comment block beneath an item if enabled for this item and handle the binding if there is one
 * 
 * @param parent
 * @param templateItem
 * @param bindings
 */
public static void renderCommentBlock(UIContainer parent, EvalTemplateItem templateItem, String[] bindings) {
    // render the item comment if enabled
    boolean usesComment = templateItem.getUsesComment() == null ? false : templateItem.getUsesComment();
    if (usesComment) {
        String commentBinding = null;
        if (bindings.length >= 3) {
            commentBinding = bindings[2];
        }
        String commentInit = null;
        if (commentBinding == null) commentInit = "";

        UIBranchContainer showComment = UIBranchContainer.make(parent, "showComment:");
        UIMessage.make(showComment, "itemCommentHeader", "viewitem.comment.desc");
        UIMessage commentLink = UIMessage.make(showComment, "itemCommentShow", "comment.show");
        commentLink.decorate(new UITooltipDecorator( UIMessage.make("comment.show.tooltip") ));
        UIInput.make(showComment, "itemComment", commentBinding, commentInit);
    }
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:26,代码来源:ItemRendererImpl.java

示例2: generateDateSelector

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Generates the date picker control for the standard evaluation dates
 * 
 * @param parent the parent container
 * @param rsfId the rsf id of the checkbox
 * @param binding the EL binding for this control value
 * @param initValue null or an initial date value
 * @param currentEvalState
 * @param worksUntilState
 * @param useDateTime
 */
private void generateDateSelector(UIBranchContainer parent, String rsfId, String binding, 
        Date initValue, String currentEvalState, String worksUntilState, boolean useDateTime) {
    if ( EvalUtils.checkStateAfter(currentEvalState, worksUntilState, true) ) {
        String suffix = ".date";
        if (useDateTime) {
            suffix = ".time";
        }
        UIOutput.make(parent, rsfId + "_disabled", null, binding)
        .resolver = new ELReference("dateResolver." + suffix);
    } else {
        UIInput datePicker = UIInput.make(parent, rsfId + ":", binding);
        if (useDateTime) {
            dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_TIME_INPUT);         
        } else {
            dateevolver.setStyle(FormatAwareDateInputEvolver.DATE_INPUT);        
        }
        dateevolver.evolveDateInput(datePicker, initValue);
        
    }
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:32,代码来源:EvaluationSettingsProducer.java

示例3: setCurrentSettingsForDisplay

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Fill the current parameter names and values into the UIContainer.
 */
private void setCurrentSettingsForDisplay(UIContainer tofill) {
    Field[] evalSettingFields = EvalSettings.class.getFields();
    Arrays.sort(evalSettingFields, (Field o1, Field o2) -> o1.getName().compareTo(o2.getName()));
    for (Field field : evalSettingFields) {
        // Ignore the arrays of String and just get the String constants
        if (String.class.equals(field.getType())) {
            // Create data for new <tr> element
            UIBranchContainer row = UIBranchContainer.make(tofill, "settings:");
            String propertyName = "";
            try {
                propertyName = EvalSettings.class.getDeclaredField(field.getName()).get(String.class).toString();
            } catch (IllegalArgumentException | SecurityException | IllegalAccessException | NoSuchFieldException e) {
            }
            UIOutput.make(row, "propertyName", propertyName);
            Object settingValue = evalSettings.get(propertyName);
            UIOutput.make(row, "currentValue", null == settingValue ? "null" : settingValue.toString());
            String incomingValue = uploadedConfigValues.get(propertyName);
            UIOutput.make(row, "incomingValue", null == incomingValue ? "" : incomingValue);
        }
    }
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:25,代码来源:ImportConfigProducer.java

示例4: renderItemPrep

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Prepare to render an item, this handles blocks correctly
 * 
 * @param parent the parent container
 * @param dti the wrapped template item we will render
 */
private void renderItemPrep(UIBranchContainer parent, DataTemplateItem dti, EvalEvaluation eval) {
    int displayIncrement = 0; // stores the increment in the display number
    EvalTemplateItem templateItem = dti.templateItem;
    if (! TemplateItemUtils.isAnswerable(templateItem)) {
        // nothing to bind for unanswerable items unless it is a block parent
        if ( dti.blockChildItems != null ) {
            // Handle the BLOCK PARENT special case - block item being rendered
            displayIncrement = dti.blockChildItems.size();
        }
    } else {
        // non-block and answerable items
        displayIncrement++;
    }

    // render the item
    itemRenderer.renderItem(parent, "renderedItem:", null, templateItem, displayNumber, true, 
            renderingUtils.makeRenderProps(dti, eval, null, null) );

    // increment the display number
    displayNumber += displayIncrement;
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:28,代码来源:PreviewEvalProducer.java

示例5: emitItem

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * @param tofill
 * @param templateItem
 * @param index
 * @param templateItemOTPBinding 
 * @param templateId 
 */
private void emitItem(UIContainer tofill, EvalTemplateItem templateItem, int index, Long templateId, String templateItemOTPBinding ) {
    UIBranchContainer radiobranch = UIBranchContainer.make(tofill,
            "itemRowBlock:", templateItem.getId().toString()); //$NON-NLS-1$
    UIOutput.make(radiobranch, "hidden-item-id", templateItem.getId().toString());
    UIOutput.make(radiobranch, "item-block-num", Integer.toString(index));
    UIVerbatim.make(radiobranch, "item-block-text", FormattedText.convertFormattedTextToPlaintext(templateItem.getItem().getItemText()));
    UIInternalLink removeChildItem = UIInternalLink.make(radiobranch,	"child-remove-item", 
            new ItemViewParameters(RemoveItemProducer.VIEW_ID, (Long)null, templateItem.getId(), templateId) );
    removeChildItem.decorate(new UIFreeAttributeDecorator("templateItemId", templateItem.getId().toString()));
    removeChildItem.decorate(new UIFreeAttributeDecorator("templateId", templateId.toString()));
    removeChildItem.decorate(new UIFreeAttributeDecorator("OTP", templateItemOTPBinding));
    removeChildItem.decorate(new UITooltipDecorator(UIMessage.make("modifytemplate.item.delete")));

    UIInternalLink.make(radiobranch,	"child-ungroup-item", UIMessage.make("modifytemplate.group.ungroup"),
            new ItemViewParameters(RemoveItemProducer.VIEW_ID, (Long)null, templateItem.getId(), templateId) );
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:24,代码来源:ModifyTemplateItemsProducer.java

示例6: showHeaders

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
    * Render each group header
    * @param categorySectionBranch the parent container
    * @param associateType Assistant or Instructor value
    * @param associateId userId for Assistant or Instructor
    * @param associateIds userIds for Assistants or Instructors
    * @param selectionOption Selection setting for this user
    * @param savedSelections
    */
private void showHeaders(UIBranchContainer categorySectionBranch, String associateType, String associateId,
		Set<String> associateIds, String selectionOption, Map<String, String[]> savedSelections) {
	EvalUser user = commonLogic.getEvalUserById(associateId);
	UIMessage header = UIMessage.make(categorySectionBranch,
			"categoryHeader", "takeeval." + associateType.toLowerCase()
					+ ".questions.header",
			new Object[] { user.displayName });
	// EVALSYS-618: support for JS: add display name to title attribute of
	// legend and hide category items
	header.decorators = new DecoratorList(new UIFreeAttributeDecorator(
			"title", user.displayName));
	categorySectionBranch.decorators = new DecoratorList(
			new UIFreeAttributeDecorator(new String[] { "name", "class" },
					new String[] { user.userId, associateType.toLowerCase() + "Branch" }));
	if (!EvalAssignGroup.SELECTION_OPTION_ALL.equals(selectionOption)
			&& associateIds.size() > 1) {
		Map<String, String> cssHide = new HashMap<>();
		cssHide.put("display", "none");
		categorySectionBranch.decorators.add(new UICSSDecorator(cssHide));
	}
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:31,代码来源:TakeEvalProducer.java

示例7: fillComponents

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
public void fillComponents(UIContainer tofill, ViewParameters viewParams, ComponentChecker arg2) {
    PageEditViewParameters params = (PageEditViewParameters) viewParams;

    UIBranchContainer mode;
 
    if (params.pageId == null) {
        mode = UIBranchContainer.make(tofill, "mode-failed:");
        UIMessage.make(mode, "message", "error_pageid");
    }
    else {
        try {
            String title = handler.removePage(params.pageId);

            mode = UIBranchContainer.make(tofill, "mode-pass:");
            UIOutput.make(mode, "pageId", params.pageId);
            UIMessage.make(mode, "message", "success_removed", new Object[] {title});

        } catch (Exception e) {
            ErrorUtil.renderError(tofill, e);
        }
    }
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:23,代码来源:PageDelProducer.java

示例8: makeSamplePeerEval

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
private void makeSamplePeerEval(UIContainer parent)
{
	UIOutput.make(parent, "peer-eval-sample-title", messageLocator.getMessage("simplepage.peer-eval.sample.title"));
	
	UIBranchContainer peerReviewRows = UIBranchContainer.make(parent, "peer-eval-sample-data:");
	UIOutput.make(peerReviewRows, "peer-eval-sample-id", "1");
	UIOutput.make(peerReviewRows, "peer-eval-sample-text", messageLocator.getMessage("simplepage.peer-eval.sample.1"));
	
	peerReviewRows = UIBranchContainer.make(parent, "peer-eval-sample-data:");
	UIOutput.make(peerReviewRows, "peer-eval-sample-id", "2");
	UIOutput.make(peerReviewRows, "peer-eval-sample-text", messageLocator.getMessage("simplepage.peer-eval.sample.2"));
	
	peerReviewRows = UIBranchContainer.make(parent, "peer-eval-sample-data:");
	UIOutput.make(peerReviewRows, "peer-eval-sample-id", "3");
	UIOutput.make(peerReviewRows, "peer-eval-sample-text", messageLocator.getMessage("simplepage.peer-eval.sample.3"));
	
	peerReviewRows = UIBranchContainer.make(parent, "peer-eval-sample-data:");
	UIOutput.make(peerReviewRows, "peer-eval-sample-id", "4");
	UIOutput.make(peerReviewRows, "peer-eval-sample-text", messageLocator.getMessage("simplepage.peer-eval.sample.4"));
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:21,代码来源:ShowPageProducer.java

示例9: makeGraders

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
public void makeGraders(UIContainer parent, ArrayList<PeerEvaluation> myEvaluations){
	if(!myEvaluations.isEmpty())
		for(PeerEvaluation eval: myEvaluations){
			UIBranchContainer evalData = UIBranchContainer.make(parent, "peer-eval-data-grade:");
			UIOutput.make(evalData, "peer-eval-row-text", eval.category);
			UIOutput.make(evalData, "peer-eval-grade", String.valueOf(eval.grade));
			for(int i = 0; i < eval.graderNames.size() ; i++){
				String graderName=eval.graderNames.get(i);
				String graderId=eval.graderIds.get(i);
				UIBranchContainer graderBranch = UIBranchContainer.make(evalData, "peer-eval-grader-branch:");
				UIOutput.make(graderBranch, "peer-eval-grader-name", graderName);
				UIOutput.make(graderBranch, "peer-eval-grader-id", graderId);
			}
			UIOutput.make(evalData, "peer-eval-count", ""+eval.graderNames.size());
		}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:17,代码来源:PeerEvalStatsProducer.java

示例10: fillEntryIcon

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
private void fillEntryIcon(UIBranchContainer entrydiv, String imgUrl, String altKey, String titleKey, Boolean draft) {
    UILink ul = UILink.make(entrydiv, "blog-visibility", imgUrl);
    ul.decorate(new UIAlternativeTextDecorator(UIMessage.make(altKey)));
    ul.decorate(new UITooltipDecorator(UIMessage.make(titleKey)));

    if (draft) {
        UIMessage.make(entrydiv, "blog-draft", "blogwow.blogview.draft");
    } else {
        UIOutput.make(entrydiv, "blog-draft", " ");
    }
}
 
开发者ID:sakaicontrib,项目名称:blogwow,代码行数:12,代码来源:BlogViewProducer.java

示例11: renderReponseRateColumn

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Renders the response rate column (since the logic is complex)
 * 
 * @param container the branch container (must contain the following elements):
 *      responseRateDisplay (output)
 *      responseRateLink (link)
 * @param evaluationId the id of the evaluation
 * @param responsesNeeded responses needed before results can be viewed (0 indicates they can be viewed now),
 *      normally should be the output from EvalBeanUtils.getResponsesNeededToViewForResponseRate(responsesCount, enrollmentsCount)
 * @param responseString the string representing the response rate output
 * @param allowedViewResponders if true, this user can view the responders listing,
 *      normally only if user have view responders permission or is admin user
 * @param allowedEmailStudents if true, this user can send emails to evaluators,
 *      normally only if EvalSettings.INSTRUCTOR_ALLOWED_EMAIL_STUDENTS is true or is admin/owner of eval
 * 
 * Sample html (from summary.html):
  <tr rsf:id="evalResponsesList:">
    ...
    <td nowrap="nowrap">
      <a rsf:id="responseRateLink" href="evaluation_responders.html">2 of 39</a>
      <span rsf:id="responseRateDisplay"></span>
    </td>
  </tr>
 * 
 */
public static void renderReponseRateColumn(UIBranchContainer container, Long evaluationId, 
        int responsesNeeded, String responseString, boolean allowedViewResponders, boolean allowedEmailStudents) {
    if (container == null) { throw new IllegalArgumentException("container must be set"); }
    if (evaluationId == null) { throw new IllegalArgumentException("evaluationId must be set"); }
    if (responseString == null || "".equals(responseString)) { throw new IllegalArgumentException("responseString must be set"); }
    /* Responses column:
     * - if min responses reached and user have view responders permission: link to the responders view 
     * - else if INSTRUCTOR_ALLOWED_EMAIL_STUDENTS: link to notifications (send emails) view 
     * - else no options enabled and not admin ONLY show the text of the responses info (and tooltip if min responses not reached)
     */
    boolean showRespondersLink = (responsesNeeded == 0 && allowedViewResponders);
    UIComponent responseRateCompoenent;
    if (allowedEmailStudents || showRespondersLink) {
        ViewParameters viewparams;
        if (showRespondersLink) {
            viewparams = new EvalViewParameters( EvaluationRespondersProducer.VIEW_ID, evaluationId );
        } else if (allowedEmailStudents) {
            viewparams = new EvalViewParameters( EvaluationNotificationsProducer.VIEW_ID, evaluationId );
        } else {
            throw new RuntimeException("Bad logic in renderReponseRateColumn: should not be possible to reach this");
        }
        responseRateCompoenent = UIInternalLink.make(container, "responseRateLink", 
                UIMessage.make("controlevaluations.eval.responses.inline", new Object[] { responseString }),
                viewparams );
    } else {
        responseRateCompoenent = UIMessage.make(container, "responseRateDisplay", "controlevaluations.eval.responses.inline", 
                new Object[] { responseString } );
    }
    if (responsesNeeded > 0) {
        // show if responses are still needed
        responseRateCompoenent.decorate(new UITooltipDecorator( 
                UIMessage.make("controlevaluations.eval.report.awaiting.responses", new Object[] { responsesNeeded }) ));
    }
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:60,代码来源:RenderingUtils.java

示例12: renderLink

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
private void renderLink(UIJointContainer joint, String linkViewID, String messageKey) {

        UIBranchContainer cell = UIBranchContainer.make(joint, "navigation-cell:");
        UIInternalLink link = UIInternalLink.make(cell, "item-link", UIMessage.make(messageKey),
                new SimpleViewParameters(linkViewID));

        if (currentViewID != null && currentViewID.equals(linkViewID)) {
            link.decorate( new UIStyleDecorator("inactive"));
        }
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:11,代码来源:NavBarRenderer.java

示例13: renderLinkForMyEvals

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
private void renderLinkForMyEvals(UIJointContainer joint, String linkViewID, String messageKey) {

        UIBranchContainer cell = UIBranchContainer.make(joint, "navigation-cell:");
        UIInternalLink link = UIInternalLink.make(cell, "item-link", UIMessage.make(messageKey),
                new EvalListParameters(linkViewID,6));

        if (currentViewID != null && currentViewID.equals(linkViewID)) {
            link.decorate( new UIStyleDecorator("inactive"));
        }
    }
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:11,代码来源:NavBarRenderer.java

示例14: fillComponents

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的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");
		}
	}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:37,代码来源:ChownTemplateProducer.java

示例15: generateViewDateControl

import uk.org.ponder.rsf.components.UIBranchContainer; //导入依赖的package包/类
/**
 * Reduces code duplication<br/>
 * This will render the view date picker control or a message depending on various system settings<br/>
 * <b>NOTE:</b> the rsfId should not include the ":" even though it must appear in the template with a colon<br/>
 * <b>NOTE:</b> the label for this message must use an rsf:id of (rsfId + "_label")<br/>
 * 
 * @param parent the parent container
 * @param rsfId the rsf id of the checkbox
 * @param binding the EL binding for this control value
 * @param viewResultsSetting
 * @param useDateTime
 * @param sameViewDateForAll
 */
protected void generateViewDateControl(UIBranchContainer parent, String rsfId, 
        String binding, Boolean viewResultsSetting, Boolean useDateTime, boolean sameViewDateForAll) {
    if (viewResultsSetting == null || viewResultsSetting) {
        // only show something if this on or configurable
        if (sameViewDateForAll) {
            // just show the text to the user since all view dates are the same AND the system setting forces this
            UIMessage.make(parent, rsfId + "_label", "evalsettings.view.results.date.label");
        } else {
            // allow them to choose the date using a date picker
            UIInput dateInput = UIInput.make(parent, rsfId + "-iso8601", binding);
        }         
    }
}
 
开发者ID:sakaicontrib,项目名称:evaluation,代码行数:27,代码来源:EvaluationSettingsProducer.java


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