本文整理汇总了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;
}
示例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);
}