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


Java EditorFieldModel.setLabel方法代码示例

本文整理汇总了Java中org.chromium.chrome.browser.payments.ui.EditorFieldModel.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Java EditorFieldModel.setLabel方法的具体用法?Java EditorFieldModel.setLabel怎么用?Java EditorFieldModel.setLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.chromium.chrome.browser.payments.ui.EditorFieldModel的用法示例。


在下文中一共展示了EditorFieldModel.setLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAddressTextFieldsToEditor

import org.chromium.chrome.browser.payments.ui.EditorFieldModel; //导入方法依赖的package包/类
/**
 * Adds text fields to the editor model based on the country and language code of the profile
 * that's being edited.
 */
private void addAddressTextFieldsToEditor(
        EditorModel container, String countryCode, String languageCode) {
    mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode,
            languageCode);

    for (int i = 0; i < mAddressUiComponents.size(); i++) {
        AddressUiComponent component = mAddressUiComponents.get(i);

        // The country field is a dropdown, so there's no need to add a text field for it.
        if (component.id == AddressField.COUNTRY) continue;

        EditorFieldModel field = mAddressFields.get(component.id);
        // Labels depend on country, e.g., state is called province in some countries. These are
        // already localized.
        field.setLabel(component.label);
        field.setIsFullLine(component.isFullLine);

        // Libaddressinput formats do not always require the full name (RECIPIENT), but
        // PaymentRequest does.
        if (component.isRequired || component.id == AddressField.RECIPIENT) {
            field.setRequiredErrorMessage(mContext.getString(
                    R.string.payments_field_required_validation_message));
        } else {
            field.setRequiredErrorMessage(null);
        }

        container.addField(field);
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:34,代码来源:AddressEditor.java

示例2: addAddressFieldsToEditor

import org.chromium.chrome.browser.payments.ui.EditorFieldModel; //导入方法依赖的package包/类
/**
 * Adds fields to the editor model based on the country and language code of
 * the profile that's being edited.
 */
private void addAddressFieldsToEditor(
        String countryCode, String languageCode, String[] adminAreas) {
    mAddressUiComponents =
            mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode);
    // In terms of order, country must be the first field.
    mEditor.addField(mCountryField);
    for (int i = 0; i < mAddressUiComponents.size(); i++) {
        AddressUiComponent component = mAddressUiComponents.get(i);

        EditorFieldModel field = mAddressFields.get(component.id);
        // Labels depend on country, e.g., state is called province in some countries. These are
        // already localized.
        field.setLabel(component.label);
        field.setIsFullLine(component.isFullLine || component.id == AddressField.LOCALITY
                || component.id == AddressField.DEPENDENT_LOCALITY);

        if (component.id == AddressField.ADMIN_AREA && field.isDropdownField()) {
            field.setDropdownKeyValues(
                    mAutofillProfileBridge.getAdminAreaDropdownList(adminAreas));
        }

        // Libaddressinput formats do not always require the full name (RECIPIENT), but
        // PaymentRequest does.
        if (component.isRequired || component.id == AddressField.RECIPIENT) {
            field.setRequiredErrorMessage(mContext.getString(
                    R.string.payments_field_required_validation_message));
        } else {
            field.setRequiredErrorMessage(null);
        }
        mEditor.addField(field);
    }
    // Phone number must be the last field.
    mEditor.addField(mPhoneField);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:39,代码来源:AddressEditor.java


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