本文整理匯總了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;
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}