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


Java ComponentFactory类代码示例

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


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

示例1: addConfirmDialogToView

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * For confirm text without a dialog, add instance of yes no dialog to view so it is already available
 * on the client for dynamic dialog creation.
 */
protected void addConfirmDialogToView() {
    if (StringUtils.isBlank(confirmationPromptText) || (confirmationDialog != null)) {
        return;
    }

    boolean containsYesNoDialog = false;

    List<Group> viewDialogs = ViewLifecycle.getView().getDialogs();
    if (viewDialogs == null) {
        viewDialogs = new ArrayList<Group>();
    } else {
        for (Group dialogGroup : viewDialogs) {
            if (StringUtils.equals(ComponentFactory.YES_NO_DIALOG, dialogGroup.getId())) {
                containsYesNoDialog = true;
            }
        }
    }

    if (!containsYesNoDialog) {
        Group confirmDialog = ComponentFactory.getYesNoDialog();
        confirmDialog.setId(ComponentFactory.YES_NO_DIALOG);

        viewDialogs.add(confirmDialog);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:Action.java

示例2: performApplyModel

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Sets up rich message content for the label, if any exists
 *
 * {@inheritDoc}
 */
@Override
public void performApplyModel(Object model, LifecycleElement parent) {
    super.performApplyModel(model, parent);

    if (richHeaderMessage == null && headerText != null && headerText.contains(
            KRADConstants.MessageParsing.LEFT_TOKEN) && headerText.contains(
            KRADConstants.MessageParsing.RIGHT_TOKEN)) {
        Message message = ComponentFactory.getMessage();
        message.setMessageText(headerText);
        message.setInlineComponents(inlineComponents);
        message.setRenderWrapperTag(false);
        
        this.setRichHeaderMessage(message);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:Header.java

示例3: performApplyModel

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Sets up rich message content for the label, if any exists
 *
 * {@inheritDoc}
 */
@Override
public void performApplyModel(Object model, LifecycleElement parent) {
    super.performApplyModel(model, parent);

    if (richLabelMessage == null && labelText != null &&
            labelText.contains(KRADConstants.MessageParsing.LEFT_TOKEN) &&
            labelText.contains(KRADConstants.MessageParsing.RIGHT_TOKEN)) {
        Message message = ComponentFactory.getMessage();
        message.setMessageText(labelText);
        message.setInlineComponents(inlineComponents);
        message.setRenderWrapperTag(false);

        this.setRichLabelMessage(message);
    }

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:Label.java

示例4: performInitialization

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void performInitialization(Object model) {
    super.performInitialization(model);

    if ((StringUtils.isNotBlank(constraintText) || (getPropertyExpression("constraintText") != null)) && (
            constraintMessage
                    == null)) {
        constraintMessage = ComponentFactory.getConstraintMessage();
    }

    if ((StringUtils.isNotBlank(instructionalText) || (getPropertyExpression("instructionalText") != null)) && (
            instructionalMessage
                    == null)) {
        instructionalMessage = ComponentFactory.getInstructionalMessage();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:InputFieldBase.java

示例5: deriveInquiryViewFromMetadata

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.uif.service.UifDefaultingService#deriveInquiryViewFromMetadata(org.kuali.rice.krad.datadictionary.DataObjectEntry)
 */
@Override
public InquiryView deriveInquiryViewFromMetadata(DataObjectEntry dataObjectEntry) {
    // Create the main view object and set the title and BO class
    InquiryView view = ComponentFactory.getInquiryView();
    view.setHeaderText(dataObjectEntry.getObjectLabel());
    view.setDataObjectClassName(dataObjectEntry.getDataObjectClass());

    addAttributeSectionsToInquiryView(view, dataObjectEntry);

    // TODO: if there are updatable reference objects, include sections for them

    // If there are collections on the object, include sections for them
    addCollectionSectionsToInquiryView(view, dataObjectEntry);

    return view;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:UifDefaultingServiceImpl.java

示例6: initializeEditLineDialog

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Helper method to initialize the edit line dialog and add it to the line dialogs for the group.
 *
 * @param collectionGroup the collection group to initialize the line dialogs for
 * @param lineIndex the current line index
 * @param currentLine the data object bound to the current line
 * @param model the view's data
 */
protected void initializeEditLineDialog(CollectionGroup collectionGroup, int lineIndex, Object currentLine,
        Object model) {
    if (!collectionGroup.isEditWithDialog()) {
        return;
    }

    String lineSuffix = UifConstants.IdSuffixes.LINE + Integer.toString(lineIndex);

    // use the edit line dialog prototype to initialilze the edit line dialog
    DialogGroup editLineDialog = ComponentUtils.copy(collectionGroup.getEditLineDialogPrototype());
    editLineDialog.setId(ComponentFactory.EDIT_LINE_DIALOG + "_" + collectionGroup.getId() + lineSuffix);
    editLineDialog.setRetrieveViaAjax(true);

    if (refreshEditLineDialogContents(editLineDialog, model, collectionGroup, lineIndex)) {
        // if this is an edit line, set up the edit line dialog and add it to the list of dialogs
        currentLine = ((UifFormBase) model).getDialogDataObject();
        setupEditLineDialog(editLineDialog, collectionGroup, lineIndex, lineSuffix, currentLine);
    }

    // add the edit line dialog to the list of line dialogs for the group
    if (collectionGroup.getLineDialogs() == null || collectionGroup.getLineDialogs().isEmpty()) {
        collectionGroup.setLineDialogs((new ArrayList<DialogGroup>()));
    }
    collectionGroup.getLineDialogs().add(editLineDialog);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:34,代码来源:CollectionGroupBuilder.java

示例7: setupEditLineActionForDialog

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Helper method to setup the edit line action to show the dialog
 *
 * @param collectionGroup the collection group the line belongs to
 * @param lineSuffix the line index of the current line
 * @param lineIndex the current line index
 * @param actionIndex the action index used in the id
 * @return the line action for edit line in dialog
 */
protected Action setupEditLineActionForDialog(CollectionGroup collectionGroup, String lineSuffix, int lineIndex,
        int actionIndex) {

    Action action = ComponentUtils.copy(collectionGroup.getEditWithDialogActionPrototype());

    action.setId(ComponentFactory.EDIT_LINE_IN_DIALOG_ACTION + "_" + collectionGroup.getId() +
            lineSuffix + UifConstants.IdSuffixes.ACTION + actionIndex);

    String actionScript = UifConstants.JsFunctions.SHOW_EDIT_LINE_DIALOG + "('" +
            ComponentFactory.EDIT_LINE_DIALOG + "_" + collectionGroup.getId() + lineSuffix + "', '" +
            collectionGroup.getBindingInfo().getBindingName() + "', " + lineIndex + ");";
    action.setActionScript(actionScript);

    return action;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:CollectionGroupBuilder.java

示例8: performInitialization

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * The following initialization is performed:
 *
 * <ul>
 * <li>Sorts the containers list of components</li>
 * <li>Initializes the instructional field if necessary</li>
 * <li>Initializes LayoutManager</li>
 * </ul>
 *
 * {@inheritDoc}
 */
@SuppressWarnings("deprecation")
@Override
public void performInitialization(Object model) {
    super.performInitialization(model);

    if ((StringUtils.isNotBlank(instructionalText) || (getPropertyExpression("instructionalText") != null)) && (
            instructionalMessage
                    == null)) {
        instructionalMessage = ComponentFactory.getInstructionalMessage();
    }

    if (layoutManager != null && !this.getItems().isEmpty()) {
        layoutManager.performInitialization(model);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:ContainerBase.java

示例9: performInitialization

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * The following initialization is performed:
 *
 * <ul>
 * <li>If help action not initialized and external help is configured, get the default
 * help action component</li>
 * </ul>
 *
 * {@inheritDoc}
 */
@Override
public void performInitialization(Object model) {
    super.performInitialization(model);

    if (helpAction == null) {
        if(hasValueOrPropertyExpression(externalHelpUrl, this, "externalHelpUrl") ||  (
                helpDefinition != null &&
                        hasValueOrPropertyExpression(helpDefinition.getParameterName(), helpDefinition, "parameterName") &&
                        hasValueOrPropertyExpression(helpDefinition.getParameterDetailType(), helpDefinition, "parameterDetailType")
        )){
            helpAction = ComponentFactory.getHelpAction();
            helpAction.addDataAttribute(UifConstants.DataAttributes.ROLE, "help");
        }
    }
    else{
        helpAction.addDataAttribute(UifConstants.DataAttributes.ROLE, "help");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:Help.java

示例10: performInitialization

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void performInitialization(Object model) {
    CollectionGroup collectionGroup = (CollectionGroup) ViewLifecycle.getPhase().getElement();

    if (Boolean.TRUE.equals(collectionGroup.getReadOnly())) {
        getAddLineGroup().setReadOnly(true);
        actionFieldPrototype.setReadOnly(true);
    }

    this.setupDetails(collectionGroup);
    this.setupGrouping(model, collectionGroup);

    if (collectionGroup.isAddWithDialog()) {
        setSeparateAddLine(true);
    }

    super.performInitialization(model);

    getRowCssClasses().clear();

    if (generateAutoSequence && !(getSequenceFieldPrototype() instanceof MessageField)) {
        sequenceFieldPrototype = ComponentFactory.getMessageField();
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:TableLayoutManagerBase.java

示例11: performFinalize

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * The following actions are performed:
 *
 * <ul>
 * <li>Add all option if enabled and control is multi-value</li>
 * </ul>
 *
 * {@inheritDoc}
 */
@Override
public void performFinalize(Object model, LifecycleElement parent) {
    super.performFinalize(model, parent);

    // if enabled add option to select all values
    if (addControlSelectAllOption && (getControl() != null) && getControl() instanceof MultiValueControl) {
        String allOptionText = KRADServiceLocatorWeb.getMessageService().getMessageText(
                UifConstants.MessageKeys.OPTION_ALL);

        MultiValueControl multiValueControl = (MultiValueControl) getControl();
        if (multiValueControl.getOptions() != null) {
            multiValueControl.getOptions().add(0, new ConcreteKeyValue("", allOptionText));
        }

        if (multiValueControl.getRichOptions() != null) {
            Message message = ComponentFactory.getMessage();
            message.setMessageText(allOptionText);
            message.setRenderWrapperTag(false);

            multiValueControl.getRichOptions().add(0, new KeyMessage("", allOptionText, message));
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:LookupInputField.java

示例12: performCustomInitialization

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
@Override
public void performCustomInitialization(LifecycleElement component) {
    super.performCustomInitialization(component);
    List<Component> fields = new ArrayList<Component>();
    if(component instanceof PageGroup && component.getId().equals("UifGeneratedFields-Page1")){
        for(int i=0; i < 400; i++){
            InputField field = ComponentFactory.getInputField();
            Control control = ComponentFactory.getTextControl();
            field.setControl(control);
            field.setPropertyName("field1");
            field.setLabel("Field");
            field.setRequired(true);
            fields.add(field);
        }
        ((PageGroup) component).setItems(fields);
    }

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:UifGeneratedTestViewHelperServiceImpl.java

示例13: addCustomContainerComponents

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
@Override
public void addCustomContainerComponents(ViewModel model, Container container) {
    if (PROPOSITION_GROUP_ID.equals(container.getId())) {
        RuleBo ruleDataObj = (RuleBo)((InquiryForm)model).getDataObject();
        PropositionBo proposition = ruleDataObj.getProposition();
        if (proposition != null) {
            if (PropositionType.COMPOUND.getCode().equals(proposition.getPropositionTypeCode())) {
                List<Component> groups = new ArrayList<Component>();
                handleCompoundPropositions(groups, proposition);
                container.setItems(groups);
            } else {
                Message simplePropName = ComponentFactory.getMessage();
                simplePropName.setId(PROPOSITION_ID + "_" + ID++);
                simplePropName.setMessageText(proposition.getDescription());
                List<Message> simpleProps = new ArrayList<Message>();
                simpleProps.add(simplePropName);
                container.setItems(simpleProps);
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:RuleStudentInquiryViewHelperServiceImpl.java

示例14: performApplyModel

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Process rich message content that may be in the options, by creating and initializing the richOptions
 *
 * @see org.kuali.rice.krad.uif.component.ComponentBase#performApplyModel(org.kuali.rice.krad.uif.view.View,
 *      Object, org.kuali.rice.krad.uif.component.Component)
 */
@Override
public void performApplyModel(View view, Object model, Component parent) {
    super.performApplyModel(view, model, parent);

    if (options != null && richOptions == null) {
        richOptions = new ArrayList<KeyMessage>();

        for (KeyValue option : options) {
            Message message = ComponentFactory.getMessage();
            view.assignComponentIds(message);
            message.setMessageText(option.getValue());
            message.setInlineComponents(inlineComponents);
            message.setGenerateSpan(false);

            view.getViewHelperService().performComponentInitialization(view, model, message);
            richOptions.add(new KeyMessage(option.getKey(), option.getValue(), message));
        }
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:26,代码来源:MultiValueControlBase.java

示例15: autoAddActiveCriteria

import org.kuali.rice.krad.uif.util.ComponentFactory; //导入依赖的package包/类
/**
 * Adds the 'active' property criteria to the criteria fields if the BO is inactivatable
 */
private void autoAddActiveCriteria() {
    boolean hasActiveCriteria = false;

    for (Component field : getCriteriaFields()) {
        if (((InputField)field).getPropertyName().equals("active")) {
            hasActiveCriteria = true;
        }
    }

    if (!hasActiveCriteria) {
        AttributeDefinition attributeDefinition = KRADServiceLocatorWeb.getDataDictionaryService().getAttributeDefinition(
                dataObjectClassName.getName(), "active");
        LookupInputField activeField = new LookupInputField();

        if (attributeDefinition == null) {
            activeField = (LookupInputField)ComponentFactory.getNewComponentInstance("Uif-LookupActiveInputField");
        }else{
            activeField = (LookupInputField)ComponentFactory.getNewComponentInstance("Uif-LookupCriteriaInputField");
            activeField.setPropertyName("active");
            activeField.copyFromAttributeDefinition(this, attributeDefinition);
        }

        getCriteriaFields().add(activeField);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:LookupView.java


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