當前位置: 首頁>>代碼示例>>Java>>正文


Java OptionGroup類代碼示例

本文整理匯總了Java中com.vaadin.v7.ui.OptionGroup的典型用法代碼示例。如果您正苦於以下問題:Java OptionGroup類的具體用法?Java OptionGroup怎麽用?Java OptionGroup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


OptionGroup類屬於com.vaadin.v7.ui包,在下文中一共展示了OptionGroup類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTestComponent

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
@Override
public Component getTestComponent() {

    EnumSelect<AddressType> select = new EnumSelect<AddressType>()
            .withSelectType(OptionGroup.class);
    select.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);

    // The Enum type is detected when the edited property is bound to select
    // This typically comes form basic bean binding, but here done manually.
    ObjectProperty objectProperty = new ObjectProperty(AddressType.Home);
    select.setPropertyDataSource(objectProperty);
    
    // Alternatively, if not using databinding at all, you could just use 
    // basic TypedSelect, or the method from it
    // select.setOptions(AddressType.values());

    return select;
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:19,代碼來源:EnumFieldAsRadioButtonGroup.java

示例2: withSelectType

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
public TypedSelect<T> withSelectType(
        Class<? extends AbstractSelect> selectType) {
    if (selectType == ListSelect.class) {
        asListSelectType();
    } else if (selectType == OptionGroup.class) {
        asOptionGroupType();
    } else if (selectType == ComboBox.class) {
        asComboBoxType();
    } else {
        asNativeSelectType();
    }
    return this;
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:14,代碼來源:TypedSelect.java

示例3: configurateOptionGroup

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
public void configurateOptionGroup(OptionGroup optionGroup) {
    if (htmlContentAllowed != null) {
        optionGroup.setHtmlContentAllowed(htmlContentAllowed);
    }
    if (disabledItemIds != null) {
        for (Object o : disabledItemIds) {
            optionGroup.setItemEnabled(o, false);
        }
    }
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:11,代碼來源:OptionGroupConfig.java

示例4: getTestComponent

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
@Override
public Component getTestComponent() {
    TypedSelect<AddressType> types = new TypedSelect<AddressType>()
            .withSelectType(OptionGroup.class)
            .setOptions(AddressType.values()); // AddressType is an enum
    types.selectFirst();
    return types;
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:9,代碼來源:TypedSelectOptionGroup.java

示例5: getOptiongroup

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
private OptionGroup getOptiongroup() {
    OptionGroup languageSelect = new OptionGroup();
    Locale[] availableLocales = new Locale[] { Locale.CANADA,
            Locale.ENGLISH, Locale.GERMAN };
    for (Locale locale : availableLocales) {
        languageSelect.addItem(locale);
        languageSelect.setItemCaption(locale,
                locale.getDisplayLanguage(locale));
    }
    languageSelect.setValue(Locale.ENGLISH);
    return languageSelect;
}
 
開發者ID:vaadin,項目名稱:touchkit,代碼行數:13,代碼來源:VerticalComponentGroupTest.java

示例6: getUndelayingTable

import com.vaadin.v7.ui.OptionGroup; //導入依賴的package包/類
/**
 * @return the underlaying table implementation. Protected as one should
 * expect odd behavior if it configured in unsupported manner.
 */
protected OptionGroup getUndelayingTable() {
    return optionGroup;
}
 
開發者ID:viritin,項目名稱:viritin,代碼行數:8,代碼來源:CheckBoxGroup.java


注:本文中的com.vaadin.v7.ui.OptionGroup類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。