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


Java Label类代码示例

本文整理汇总了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>();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:TableLayoutManagerBase.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:TableLayoutManagerBase.java

示例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;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:37,代码来源:TableLayoutManager.java

示例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;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:40,代码来源:LightTable.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:CssGridLabelColumnLayoutManager.java

示例6: getHeaderLabelPrototype

import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@ViewLifecycleRestriction(UifConstants.ViewPhases.INITIALIZE)
@BeanTagAttribute
public Label getHeaderLabelPrototype() {
    return this.headerLabelPrototype;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:TableLayoutManagerBase.java

示例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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:40,代码来源:ComponentUtilsTest.java

示例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;
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:LightTable.java

示例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>();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:15,代码来源:TableLayoutManager.java

示例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);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:36,代码来源:TableLayoutManager.java

示例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);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:60,代码来源:LabelSeparateModifier.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:8,代码来源:FieldBase.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:FieldBase.java

示例14: setHeaderLabels

import org.kuali.rice.krad.uif.element.Label; //导入依赖的package包/类
public void setHeaderLabels(List<Label> headerLabels) {
    this.headerLabels = headerLabels;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:LightTable.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:52,代码来源:TableExporter.java


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