本文整理汇总了Java中org.kuali.rice.krad.uif.element.Label类的典型用法代码示例。如果您正苦于以下问题:Java Label类的具体用法?Java Label怎么用?Java Label使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Label类属于org.kuali.rice.krad.uif.element包,在下文中一共展示了Label类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TableLayoutManagerBase
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
public TableLayoutManagerBase() {
useShortLabels = false;
repeatHeader = false;
renderSequenceField = true;
generateAutoSequence = false;
separateAddLine = false;
rowDetailsOpen = false;
rowCssClasses = new ArrayList<String>();
rowDataAttributes = new ArrayList<String>();
headerLabels = new ArrayList<Label>();
allRowFields = new ArrayList<Field>();
firstRowFields = new ArrayList<Field>();
columnsToCalculate = new ArrayList<String>();
columnCalculations = new ArrayList<ColumnCalculationInfo>();
conditionalRowCssClasses = new HashMap<String, String>();
}
示例2: setupTotalField
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* Setup the totalField with the columnCalculationInfo(cInfo) passed in. Param show represents
* the tableLayoutManager's setting for the type of total being processed.
*
* @param totalField the field to setup
* @param cInfo ColumnCalculation info to use to setup the field
* @param show show the field (if renderOnlyLeftTotalLabels is true, otherwise uses value in
* cInfo)
* @param leftLabel the leftLabel, not used if renderOnlyLeftTotalLabels is false
* @param type type used to set the dataAttribute role - used by the js for selection
* @param leftLabelColumnIndex index of the leftLabelColumn (0 or 1 if grouping enabled - hidden
* column)
* @return the field with cInfo and tableLayoutManager settings applied as appropriate
*/
protected Field setupTotalField(Field totalField, ColumnCalculationInfo cInfo, boolean show, Label leftLabel,
String type, int leftLabelColumnIndex) {
//setup the totals field
Field totalDataField = totalField;
totalDataField.addDataAttribute(UifConstants.DataAttributes.ROLE, type);
totalDataField.addDataAttribute("function", cInfo.getCalculationFunctionName());
totalDataField.addDataAttribute("params", cInfo.getCalculationFunctionExtraData());
if (cInfo.getColumnNumber() != leftLabelColumnIndex) {
//do not render labels for columns which have totals and the renderOnlyLeftTotalLabels
//flag is set
totalDataField.getFieldLabel().setRender(!this.isRenderOnlyLeftTotalLabels());
} else if (cInfo.getColumnNumber() == leftLabelColumnIndex && this.isRenderOnlyLeftTotalLabels()) {
//renderOnlyLeftTotalLabel is set to true, but the column has a total itself - set the layout
//manager settings directly into the field
totalDataField.setFieldLabel((Label) CopyUtils.copy(leftLabel));
}
if (this.isRenderOnlyLeftTotalLabels()) {
totalDataField.setRender(show);
}
return totalDataField;
}
示例3: setupTotalField
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* Setup the totalField with the columnCalculationInfo(cInfo) passed in. Param show represents the
* tableLayoutManager's setting for the type of total being processed.
*
* @param totalField the field to setup
* @param cInfo ColumnCalculation info to use to setup the field
* @param show show the field (if renderOnlyLeftTotalLabels is true, otherwise uses value in cInfo)
* @param leftLabel the leftLabel, not used if renderOnlyLeftTotalLabels is false
* @param type type used to set the dataAttribute role - used by the js for selection
* @param leftLabelColumnIndex index of the leftLabelColumn (0 or 1 if grouping enabled - hidden column)
* @return the field with cInfo and tableLayoutManager settings applied as appropriate
*/
protected Field setupTotalField(Field totalField, ColumnCalculationInfo cInfo, boolean show, Label leftLabel,
String type, int leftLabelColumnIndex) {
//setup the totals field
Field totalDataField = totalField;
totalDataField.addDataAttribute(UifConstants.DataAttributes.ROLE, type);
totalDataField.addDataAttribute("function", cInfo.getCalculationFunctionName());
totalDataField.addDataAttribute("params", cInfo.getCalculationFunctionExtraData());
if (cInfo.getColumnNumber() != leftLabelColumnIndex) {
//do not render labels for columns which have totals and the renderOnlyLeftTotalLabels
//flag is set
totalDataField.getFieldLabel().setRender(!this.isRenderOnlyLeftTotalLabels());
} else if (cInfo.getColumnNumber() == leftLabelColumnIndex && this.isRenderOnlyLeftTotalLabels()) {
//renderOnlyLeftTotalLabel is set to true, but the column has a total itself - set the layout
//manager settings directly into the field
totalDataField.setFieldLabel(leftLabel);
}
if (this.isRenderOnlyLeftTotalLabels()) {
totalDataField.setRender(show);
}
return totalDataField;
}
示例4: performFinalize
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* performFinalize override corrects the binding path for the DataFields and turns off rendering on some components
*/
@Override
public void performFinalize(Object model, LifecycleElement parent) {
super.performFinalize(model, parent);
headerLabels = new ArrayList<Label>();
for (Component item : this.getItems()) {
//get the header labels
if (item instanceof Field) {
headerLabels.add(ComponentUtils.copy(((Field) item).getFieldLabel()));
((Field) item).getFieldLabel().setRender(false);
} else {
headerLabels.add(null);
}
if (item instanceof FieldGroup) {
((FieldGroup) item).getGroup().setValidationMessages(null);
}
if (item instanceof DataField) {
((DataField) item).getBindingInfo().setBindByNamePrefix(this.getBindingInfo().getBindingPath() + "[0]");
}
if (item instanceof InputField) {
ViewLifecycle.getViewPostMetadata().addAccessibleBindingPath(this.getBindingInfo().getBindingPath() + "[*]." + ((DataField) item).getPropertyName());
}
}
Object collectionValue = ObjectPropertyUtils.getPropertyValue(model, bindingInfo.getBindingPath());
//set emptyTable true if null, empty, or not valid collection
if (collectionValue == null || !(collectionValue instanceof Collection) ||
((Collection<?>) collectionValue).isEmpty()) {
emptyTable = true;
}
}
示例5: 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;
}
示例6: getHeaderLabelPrototype
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
@ViewLifecycleRestriction(UifConstants.ViewPhases.INITIALIZE)
@BeanTagAttribute
public Label getHeaderLabelPrototype() {
return this.headerLabelPrototype;
}
示例7: testCleanContextDeap
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* Test {@link ContextUtils#cleanContextDeep} using a BreadcrumbItem object
*/
@Test
public void testCleanContextDeap() {
Map<String, Object> context = new HashMap<String, Object>();
context.put("contextkey", "value");
context.put("contextkey2", "value2");
BreadcrumbItem breadcrumbItem = new BreadcrumbItem();
breadcrumbItem.setContext(context);
InputField inputField = new InputFieldBase();
inputField.setContext(context);
Label fieldLabel = new Label();
fieldLabel.setContext(context);
Tooltip labelTootlip = new Tooltip();
labelTootlip.setContext(context);
fieldLabel.setToolTip(labelTootlip);
inputField.setFieldLabel(fieldLabel);
breadcrumbItem.setSiblingBreadcrumbComponent(inputField);
Tooltip tooltip = new Tooltip();
tooltip.setContext(context);
breadcrumbItem.setToolTip(tooltip);
ContextUtils.cleanContextDeep(breadcrumbItem);
assertEquals(0, breadcrumbItem.getContext().size());
assertEquals(0, inputField.getContext().size());
assertEquals(0, fieldLabel.getContext().size());
assertEquals(0, labelTootlip.getContext().size());
assertEquals(0, tooltip.getContext().size());
}
示例8: performFinalize
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* performFinalize override corrects the binding path for the DataFields and turns off rendering on some components
*/
@Override
public void performFinalize(View view, Object model, Component parent) {
super.performFinalize(view, model, parent);
headerLabels = new ArrayList<Label>();
for (Component item : this.getItems()) {
//get the header labels
if (item instanceof Field) {
headerLabels.add(ComponentUtils.copy(((Field) item).getFieldLabel()));
((Field) item).getFieldLabel().setRender(false);
} else {
headerLabels.add(null);
}
if (item instanceof FieldGroup) {
((FieldGroup) item).getGroup().setValidationMessages(null);
}
if (item instanceof DataField) {
((DataField) item).getBindingInfo().setBindByNamePrefix(this.getBindingInfo().getBindingPath() + "[0]");
}
}
Object collectionValue = ObjectPropertyUtils.getPropertyValue(model, bindingInfo.getBindingPath());
//set emptyTable true if null, empty, or not valid collection
if (collectionValue == null || !(collectionValue instanceof Collection) ||
((Collection) collectionValue).isEmpty()) {
emptyTable = true;
}
}
示例9: TableLayoutManager
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
public TableLayoutManager() {
useShortLabels = false;
repeatHeader = false;
renderSequenceField = true;
generateAutoSequence = false;
separateAddLine = false;
rowDetailsOpen = false;
headerLabels = new ArrayList<Label>();
allRowFields = new ArrayList<Field>();
firstRowFields = new ArrayList<Field>();
columnsToCalculate = new ArrayList<String>();
columnCalculations = new ArrayList<ColumnCalculationInfo>();
}
示例10: 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. After created the header field is added to the list
* making up the table header
*
* @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) {
Label headerLabel = ComponentUtils.copy(getHeaderLabelPrototype(), "_c" + column);
if (useShortLabels) {
headerLabel.setLabelText(field.getShortLabel());
} else {
headerLabel.setLabelText(field.getLabel());
}
headerLabel.setRowSpan(field.getRowSpan());
headerLabel.setColSpan(field.getColSpan());
if ((field.getRequired() != null) && field.getRequired().booleanValue()) {
headerLabel.getRequiredMessage().setRender(!field.isReadOnly());
} else {
headerLabel.getRequiredMessage().setRender(false);
}
setCellAttributes(field);
// copy cell attributes from the field to the label
headerLabel.setCellCssClasses(field.getCellCssClasses());
headerLabel.setCellStyle(field.getCellStyle());
headerLabel.setCellWidth(field.getCellWidth());
headerLabels.add(headerLabel);
}
示例11: 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);
}
示例12: getFieldLabel
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.uif.field.Field#getLabel
*/
@BeanTagAttribute
public Label getFieldLabel() {
return this.fieldLabel;
}
示例13: setFieldLabel
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* @see org.kuali.rice.krad.uif.field.Field#setFieldLabel
*/
public void setFieldLabel(Label fieldLabel) {
this.fieldLabel = fieldLabel;
}
示例14: setHeaderLabels
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
public void setHeaderLabels(List<Label> headerLabels) {
this.headerLabels = headerLabels;
}
示例15: buildExportTableData
import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
* Generates formatted table data based on the posted view results and format type.
*
* @param collectionGroup collection group instance that should be exported
* @param model top level object containing the data
* @param formatType format which the table should be generated in
* @return generated table data
*/
public static String buildExportTableData(CollectionGroup collectionGroup, Object model, String formatType) {
// load table format elements used for generated particular style
Map<String, String> exportTableFormatOptions = getExportTableFormatOptions(formatType);
String startTable = exportTableFormatOptions.get("startTable");
String endTable = exportTableFormatOptions.get("endTable");
StringBuilder tableRows = new StringBuilder("");
TableLayoutManager layoutManager = (TableLayoutManager) collectionGroup.getLayoutManager();
List<Label> headerLabels = layoutManager.getHeaderLabels();
List<Field> rowFields = layoutManager.getAllRowFields();
int numberOfColumns = layoutManager.getNumberOfColumns();
List<Integer> ignoredColumns = findIgnoredColumns(layoutManager, collectionGroup);
// append table header data as first row
if (!headerLabels.isEmpty()) {
List<String> labels = new ArrayList<String>();
for (Label label : headerLabels) {
labels.add(label.getLabelText());
}
tableRows.append(buildExportTableRow(labels, exportTableFormatOptions, ignoredColumns));
}
// load all subsequent rows to the table
if (!rowFields.isEmpty()) {
List<String> columnData = new ArrayList<String>();
for (Field field : rowFields) {
columnData.add(KRADUtils.getSimpleFieldValue(model, field));
if (columnData.size() >= numberOfColumns) {
tableRows.append(buildExportTableRow(columnData, exportTableFormatOptions, ignoredColumns));
columnData.clear();
}
}
}
return startTable + tableRows.toString() + endTable;
}