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


Java Label.setRenderRequiredIndicator方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.uif.element.Label.setRenderRequiredIndicator方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setRenderRequiredIndicator方法的具体用法?Java Label.setRenderRequiredIndicator怎么用?Java Label.setRenderRequiredIndicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.uif.element.Label的用法示例。


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

示例1: separateLabel

import org.kuali.rice.krad.uif.element.Label; //导入方法依赖的package包/类
/**
 * Returns the label on the field and sets the appropriate display settings and css classes to make it render
 * correctly
 *
 * @param field the field to get the label from
 * @return the label
 */
private Label separateLabel(Field field) {
    Label label;
    field.setLabelLeft(false);

    // pull out label field
    field.getFieldLabel().addStyleClass("displayWith-" + field.getId());
    if (!field.isRender() && StringUtils.isBlank(field.getProgressiveRender())) {
        field.getFieldLabel().setRender(false);
    } else if (!field.isRender() && StringUtils.isNotBlank(field.getProgressiveRender())) {
        field.getFieldLabel().setRender(true);
        String prefixStyle = "";
        if (StringUtils.isNotBlank(field.getFieldLabel().getStyle())) {
            prefixStyle = field.getFieldLabel().getStyle();
        }
        field.getFieldLabel().setStyle(prefixStyle + ";" + "display: none;");
    }

    label = field.getFieldLabel();

    if (field instanceof InputField && field.getRequired() != null && field.getRequired()) {
        label.setRenderRequiredIndicator(true);
    }

    // set boolean to indicate label field should not be
    // rendered with the attribute
    field.setLabelRendered(true);

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

示例2: addHeaderField

import org.kuali.rice.krad.uif.element.Label; //导入方法依赖的package包/类
/**
 * Creates a new instance of the header field prototype and then sets the label to the short (if
 * useShortLabels is set to true) or long label of the given component.
 *
 * <p>After created the header field is added to the list making up the table header</p>
 *
 * @param field field instance the header field is being created for
 * @param column column number for the header, used for setting the id
 */
protected void addHeaderField(Field field, int column) {
    String labelSuffix = UifConstants.IdSuffixes.COLUMN + column;

    Label headerLabel = ComponentUtils.copy(getHeaderLabelPrototype(), labelSuffix);

    if (useShortLabels) {
        headerLabel.setLabelText(field.getShortLabel());
    } else {
        headerLabel.setLabelText(field.getLabel());
    }

    if (field.getExpressionGraph() != null && field.getExpressionGraph().containsKey("label")) {
        if (headerLabel.getExpressionGraph() == null) {
            headerLabel.setExpressionGraph(new HashMap<String, String>());
        }
        headerLabel.getExpressionGraph().put("labelText", field.getExpressionGraph().get("label"));
        field.getExpressionGraph().remove("label");
        if (headerLabel.getPropertyExpressions() == null) {
            headerLabel.setPropertyExpressions(new HashMap<String, String>());
        }
        headerLabel.getPropertyExpressions().put("labelText", field.getPropertyExpressions().get("label"));
        field.getPropertyExpressions().remove("label");
    }

    headerLabel.setInlineComponents(field.getFieldLabel().getInlineComponents());

    headerLabel.setRowSpan(field.getRowSpan());
    headerLabel.setColSpan(field.getColSpan());

    if ((field.getRequired() != null) && field.getRequired().booleanValue()) {
        headerLabel.setRenderRequiredIndicator(!Boolean.TRUE.equals(field.getReadOnly()));
    } else {
        headerLabel.setRenderRequiredIndicator(false);
    }

    setCellAttributes(field);

    // copy cell attributes from the field to the label
    headerLabel.setWrapperCssClasses(field.getWrapperCssClasses());
    headerLabel.setWrapperStyle(field.getWrapperStyle());
    headerLabel.setCellWidth(field.getCellWidth());

    headerLabels.add(headerLabel);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:TableLayoutManagerBase.java


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