本文整理汇总了Java中org.kuali.rice.krad.uif.element.Label.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setStyle方法的具体用法?Java Label.setStyle怎么用?Java Label.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.uif.element.Label
的用法示例。
在下文中一共展示了Label.setStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performModification
import org.kuali.rice.krad.uif.element.Label; //导入方法依赖的package包/类
/**
* Iterates through the <code>Group</code> items and if the label field is
* not null and should be rendered, adds it to the new field list
* immediately before the <code>Field</code> item the label applies to.
* Finally the new list of components is set on the group
*
* {@inheritDoc}
*/
@Override
public void performModification(Object model, Component component) {
if ((component != null) && !(component instanceof Group)) {
throw new IllegalArgumentException("Compare field initializer only support Group components, found type: "
+ component.getClass());
}
if (component == null) {
return;
}
// list that will be built
List<Component> groupFields = new ArrayList<Component>();
Group group = (Group) component;
for (Component item : group.getItems()) {
if (item instanceof Field) {
Field field = (Field) item;
// pull out label field
Label label = field.getFieldLabel();
if (label != null && label.isRender())
synchronized (label) {
label.getLibraryCssClasses().clear();
label.addStyleClass("displayWith-" + field.getId());
if (!field.isRender() && StringUtils.isBlank(field.getProgressiveRender())) {
label.setRender(false);
}
else if (!field.isRender() && StringUtils.isNotBlank(field.getProgressiveRender())) {
label.setRender(true);
String prefixStyle = "";
if (StringUtils.isNotBlank(label.getStyle())) {
prefixStyle = label.getStyle();
}
label.setStyle(prefixStyle + ";" + "display: none;");
}
groupFields.add(label);
// set boolean to indicate label field should not be
// rendered with the attribute
field.setLabelRendered(true);
}
}
groupFields.add(item);
}
// update group
group.setItems(groupFields);
}