本文整理汇总了Java中com.vaadin.ui.ComboBox.setPageLength方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.setPageLength方法的具体用法?Java ComboBox.setPageLength怎么用?Java ComboBox.setPageLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setPageLength方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildCombBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
* @return a new ComboBox
*/
public ComboBox buildCombBox() {
final ComboBox targetFilter = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false,
"", prompt);
targetFilter.setImmediate(true);
targetFilter.setPageLength(7);
targetFilter.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
targetFilter.setSizeUndefined();
if (id != null) {
targetFilter.setId(id);
}
if (valueChangeListener != null) {
targetFilter.addValueChangeListener(valueChangeListener);
}
return targetFilter;
}
示例2: generateComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
* @param liste
* @param libNull
* @return une combo grace a la liste
*/
private ComboBox generateComboBox(final List<String> liste, final String libNull) {
ComboBox sampleIdCB = new ComboBox();
sampleIdCB.setPageLength(20);
sampleIdCB.setTextInputAllowed(false);
BeanItemContainer<String> dataList = new BeanItemContainer<>(String.class);
dataList.addBean(applicationContext.getMessage("filter.all", null, UI.getCurrent().getLocale()));
if (libNull != null) {
dataList.addBean(libNull);
}
dataList.addAll(liste);
sampleIdCB
.setNullSelectionItemId(applicationContext.getMessage("filter.all", null, UI.getCurrent().getLocale()));
sampleIdCB.setContainerDataSource(dataList);
sampleIdCB.setImmediate(true);
return sampleIdCB;
}
示例3: DateSelectionField
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
public DateSelectionField() {
cboMonth = new ComboBox();
cboMonth.setNullSelectionAllowed(true);
cboMonth.setPageLength(12);
cboMonth.setImmediate(true);
addMonthItems();
cboMonth.setWidth("117px");
cboDate = new ComboBox();
cboDate.setNullSelectionAllowed(true);
cboDate.setImmediate(true);
addDayItems();
cboDate.setWidth("80px");
cboYear = new ComboBox();
cboYear.setNullSelectionAllowed(true);
cboYear.setImmediate(true);
addYearItems();
cboYear.setWidth("80px");
}
示例4: getDsComboField
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox getDsComboField() {
final Container container = createContainer();
final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("bulkupload.ds.name"), "", null,
null, false, "", i18n.getMessage("bulkupload.ds.name"));
dsComboBox.setSizeUndefined();
dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
dsComboBox.setImmediate(true);
dsComboBox.setFilteringMode(FilteringMode.STARTSWITH);
dsComboBox.setPageLength(7);
dsComboBox.setContainerDataSource(container);
dsComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME_VERSION);
dsComboBox.setId(UIComponentIdProvider.BULK_UPLOAD_DS_COMBO);
dsComboBox.setWidth("100%");
return dsComboBox;
}
示例5: createField
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
public Field<?> createField(final Container dataContainer, final Object itemId, final Object propertyId,
com.vaadin.ui.Component uiContext) {
final ComponentAttribSetting setting = (ComponentAttribSetting) itemId;
Field<?> field = null;
if (propertyId.equals("value") && (setting.getValue() == null || !setting.getValue().contains("\n"))) {
final ComboBox combo = new ComboBox();
combo.setWidth(100, Unit.PERCENTAGE);
String[] functions = ModelAttributeScriptHelper.getSignatures();
for (String function : functions) {
combo.addItem(function);
}
combo.setPageLength(functions.length > 20 ? 20 : functions.length);
if (setting.getValue() != null && !combo.getItemIds().contains(setting.getValue())) {
combo.addItem(setting.getValue());
}
combo.setImmediate(true);
combo.setNewItemsAllowed(true);
combo.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
setting.setValue((String) combo.getValue());
context.getConfigurationService().save(setting);
}
});
field = combo;
}
return field;
}