• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RemotableCheckbox类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.kuali.rice.core.api.uif.RemotableCheckbox的典型用法代码示例。如果您正苦于以下问题:Java RemotableCheckbox类的具体用法?Java RemotableCheckbox怎么用?Java RemotableCheckbox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

RemotableCheckbox类属于org.kuali.rice.core.api.uif包,在下文中一共展示了RemotableCheckbox类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doCheckboxLogic

点赞 2

import org.kuali.rice.core.api.uif.RemotableCheckbox; //导入依赖的package包/类
private boolean doCheckboxLogic(String kimTypeId, String attrId) {
    final KimAttributeField attributeDefinition = getAttributeDefinition(kimTypeId, attrId);
    return attributeDefinition != null
            && attributeDefinition.getAttributeField().getControl() != null
            && (attributeDefinition.getAttributeField().getControl() instanceof RemotableCheckboxGroup
                    || attributeDefinition.getAttributeField().getControl() instanceof RemotableCheckbox);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:8,
代码来源:UiDocumentServiceImpl.java

示例2: applyControlAttributes

点赞 2

import org.kuali.rice.core.api.uif.RemotableCheckbox; //导入依赖的package包/类
private static void applyControlAttributes(RemotableAttributeField remotableField, Field field) {
    RemotableControlContract control = remotableField.getControl();
    String fieldType = null;

    if (control == null) {
        throw new IllegalStateException("Given attribute field with the following name has a null control: " + remotableField.getName());
    }
    if (control == null || control instanceof RemotableTextInput) {
        fieldType = Field.TEXT;
        if (((RemotableTextInput)remotableField.getControl()).getSize() != null) {
          field.setSize(((RemotableTextInput)remotableField.getControl()).getSize().intValue());
        }
        if (((RemotableTextInput)remotableField.getControl()).getSize() != null) {
            field.setFormattedMaxLength(((RemotableTextInput)remotableField.getControl()).getSize().intValue());
        }
    } else if (control instanceof RemotableCheckboxGroup) {
        RemotableCheckboxGroup checkbox = (RemotableCheckboxGroup)control;
        fieldType = Field.CHECKBOX;
        field.setFieldValidValues(FieldUtils.convertMapToKeyValueList(checkbox.getKeyLabels()));
    } else if (control instanceof RemotableCheckbox) {
        fieldType = Field.CHECKBOX;
    } else if (control instanceof RemotableHiddenInput) {
        fieldType = Field.HIDDEN;
    } else if (control instanceof RemotablePasswordInput) {
        throw new IllegalStateException("Password control not currently supported.");
    } else if (control instanceof RemotableRadioButtonGroup) {
        fieldType = Field.RADIO;
        RemotableRadioButtonGroup radioControl = (RemotableRadioButtonGroup)control;
        field.setFieldValidValues(FieldUtils.convertMapToKeyValueList(radioControl.getKeyLabels()));
    } else if (control instanceof RemotableSelect) {
        RemotableSelect selectControl = (RemotableSelect)control;

        field.setFieldValidValues(FieldUtils.convertMapToKeyValueList(selectControl.getKeyLabels()));
        if (selectControl.isMultiple()) {
            fieldType = Field.MULTISELECT;
        } else if (selectControl.isRefreshOnChange()) {
            fieldType = Field.DROPDOWN_REFRESH;
        } else {
            fieldType = Field.DROPDOWN;
        }
    } else if (control instanceof RemotableTextarea) {
        fieldType = Field.TEXT_AREA;
        if (((RemotableTextarea)remotableField.getControl()).getCols() != null
                && ((RemotableTextarea)remotableField.getControl()).getRows() != null) {
            field.setCols(((RemotableTextarea)remotableField.getControl()).getCols().intValue());
            field.setSize(((RemotableTextarea)remotableField.getControl()).getRows().intValue());
        }
    } else {
        throw new IllegalArgumentException("Given control type is not supported: " + control.getClass());
    }
    // compare setting of Field default values to {@link ComponentFactory#translateRemotableField}
    if (!remotableField.getDefaultValues().isEmpty()) {
        field.setDefaultValue(remotableField.getDefaultValues().iterator().next());
        // why are these two not related? :/
        field.setPropertyValues(remotableField.getDefaultValues().toArray(new String[remotableField.getDefaultValues().size()]));
        field.setPropertyValue(field.getDefaultValue());
    }
    field.setFieldType(fieldType);
}
 

开发者ID:kuali,
项目名称:kc-rice,
代码行数:60,
代码来源:FieldUtils.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)