本文整理汇总了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;
}