本文整理汇总了Java中com.vaadin.ui.ComboBox.setTextInputAllowed方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.setTextInputAllowed方法的具体用法?Java ComboBox.setTextInputAllowed怎么用?Java ComboBox.setTextInputAllowed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setTextInputAllowed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEditFields
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
protected ComponentContainer createEditFields() {
final ExtaFormLayout form = new ExtaFormLayout();
appTitleField = new EditField("Заголовок приложения");
form.addComponent(appTitleField);
iconPathField = new ComboBox("Иконка приложения");
for (final String icon : lookup(UserSettingsService.class).getFaviconPathList()) {
iconPathField.addItem(icon);
iconPathField.setItemIcon(icon, new ThemeResource(getLast(Splitter.on('/').split(icon))));
}
iconPathField.setItemCaptionMode(AbstractSelect.ItemCaptionMode.ICON_ONLY);
iconPathField.setWidth(85, Unit.PIXELS);
iconPathField.setTextInputAllowed(false);
iconPathField.setNullSelectionAllowed(false);
form.addComponent(iconPathField);
isShowSalePointIdsField = new MCheckBox("Показывать раздел \"Идентификация\" в карточке торговой точки");
form.addComponent(isShowSalePointIdsField);
isDevServerField = new MCheckBox("Режим отладки");
form.addComponent(isDevServerField);
return form;
}
示例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: getPolicyComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox getPolicyComboBox(List<PolicyDto> policyDtoList) {
ComboBox policy = new ComboBox("Select Policy");
policy.setTextInputAllowed(false);
policy.setNullSelectionAllowed(false);
policy.setImmediate(true);
policy.setRequired(true);
policy.setRequiredError("Policy cannot be empty");
BeanItemContainer<PolicyDto> policyListContainer = new BeanItemContainer<>(PolicyDto.class,
policyDtoList);
policy.setContainerDataSource(policyListContainer);
policy.setItemCaptionPropertyId("policyName");
if (policyListContainer.size() > 0) {
policy.select(policyListContainer.getIdByIndex(0));
}
policy.setEnabled(false);
return policy;
}
示例4: createDomainComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createDomainComboBox(List<DomainDto> dl) {
ComboBox domainComboBox = new ComboBox();
BeanItemContainer<DomainDto> domainContainer = new BeanItemContainer<DomainDto>(DomainDto.class, dl);
ApplianceManagerConnectorDto mc = (ApplianceManagerConnectorDto) this.managerConnector.getValue();
domainComboBox.setContainerDataSource(domainContainer);
domainComboBox.setTextInputAllowed(false);
domainComboBox.setNullSelectionAllowed(false);
domainComboBox.setItemCaptionPropertyId("name");
domainComboBox.setEnabled(mc.isPolicyMappingSupported());
if (domainComboBox.getItemIds().size() > 0) {
domainComboBox.select(domainContainer.getIdByIndex(0));
}
return domainComboBox;
}
示例5: createEncapsulationTypeComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createEncapsulationTypeComboBox(VirtualizationType virtualizationType,
List<TagEncapsulationType> types) {
ComboBox encapsulationType = new ComboBox();
encapsulationType.setTextInputAllowed(false);
encapsulationType.setNullSelectionAllowed(true);
BeanItemContainer<TagEncapsulationType> encapsulationTypeContainer = new BeanItemContainer<TagEncapsulationType>(
TagEncapsulationType.class, types);
encapsulationType.setContainerDataSource(encapsulationTypeContainer);
ApplianceManagerConnectorDto currentMc = (ApplianceManagerConnectorDto) this.managerConnector.getValue();
if (!virtualizationType.isOpenstack() || (currentMc != null && !currentMc.isPolicyMappingSupported())) {
encapsulationType.setEnabled(false);
}
return encapsulationType;
}
示例6: buildSelection
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void buildSelection() {
exportSelectionType = new ComboBox();
exportSelectionType.setTextInputAllowed(false);
exportSelectionType.setNullSelectionAllowed(false);
exportSelectionType.setEnabled(false);
exportSelectionType.addItem(Messages.getString("Caption.Item.Selected"));
exportSelectionType.addItem(Messages.getString("Caption.Item.All"));
exportSelectionType.select(Messages.getString("Caption.Item.Selected"));
exportSelectionType.addValueChangeListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
allTestsSelected = exportSelectionType.getValue().equals(Messages.getString("Caption.Item.All"));
mainEvent.fire(new MainUIEvent.PackSelectionChangedEvent());
}
});
}
示例7: buildSelection
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
protected ComboBox buildSelection() {
final ComboBox selectionType = new ComboBox();
selectionType.setTextInputAllowed(false);
selectionType.setNullSelectionAllowed(false);
selectionType.addItem(Messages.getString("Caption.Item.Selected"));
selectionType.addItem(Messages.getString("Caption.Item.All"));
selectionType.select(Messages.getString("Caption.Item.Selected"));
selectionType.addValueChangeListener(e -> {
allSelected = selectionType.getValue().equals(Messages.getString("Caption.Item.All"));
mainEvent.fire(new MainUIEvent.UserSelectionChangedEvent());
});
return selectionType;
}
示例8: buildSelection
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
protected ComboBox buildSelection() {
final ComboBox selectionType = new ComboBox();
selectionType.setTextInputAllowed(false);
selectionType.setNullSelectionAllowed(false);
selectionType.addItem(Messages.getString("Caption.Item.Selected"));
selectionType.addItem(Messages.getString("Caption.Item.All"));
selectionType.select(Messages.getString("Caption.Item.Selected"));
selectionType.addValueChangeListener(e -> {
allSelected = selectionType.getValue().equals(Messages.getString("Caption.Item.All"));
mainEvent.fire(new MainUIEvent.GroupSelectionChangedEvent());
});
return selectionType;
}
示例9: bindEnumField
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
public ComboBox bindEnumField(ComboBox comboBox, AbstractLayout form, ValidatingFieldGroup<E> group,
String fieldLabel, String fieldName, Class<?> clazz)
{
ComboBox field = comboBox;
field.setCaption(fieldLabel);
field.setContainerDataSource(createContainerFromEnumClass(fieldName, clazz));
field.setItemCaptionPropertyId(fieldName);
// field.setCaption(fieldLabel);
field.setNewItemsAllowed(false);
field.setNullSelectionAllowed(false);
field.setTextInputAllowed(true);
field.setWidth(STANDARD_COMBO_WIDTH);
field.setPopupWidth("100%");
field.setImmediate(true);
field.setId(fieldLabel.replace(" ", ""));
addValueChangeListeners(field);
doBinding(group, fieldName, field);
form.addComponent(field);
return field;
}
示例10: getFailurePolicyComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox getFailurePolicyComboBox() {
ComboBox failurePolicy = new ComboBox("Select Failure Policy");
failurePolicy.setTextInputAllowed(false);
failurePolicy.setNullSelectionAllowed(false);
failurePolicy.setImmediate(true);
failurePolicy.setRequired(true);
failurePolicy.setRequiredError("Failure Policy cannot be empty");
failurePolicy.addItems(FailurePolicyType.FAIL_OPEN, FailurePolicyType.FAIL_CLOSE);
failurePolicy.select(FailurePolicyType.FAIL_OPEN);
failurePolicy.setEnabled(false);
return failurePolicy;
}
示例11: setCategoryFilter
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
* @param filterRow
* @return
*/
private HeaderCell setCategoryFilter(HeaderRow filterRow) {
HeaderCell categoryFilter = filterRow.getCell(CATEGORY);
ComboBox comboBox = new ComboBox();
comboBox.setHeight(100, Unit.PERCENTAGE);
comboBox.setImmediate(true);
comboBox.setNewItemsAllowed(false);
comboBox.setTextInputAllowed(false);
comboBox.addValueChangeListener(getCategoryFilterListener());
comboBox.setContainerDataSource(getCategoryDataSource());
categoryFilter.setComponent(comboBox);
return categoryFilter;
}
示例12: buildGrid
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
protected void buildGrid() {
grid = new Grid();
grid.setSelectionMode(SelectionMode.NONE);
grid.setSizeFull();
grid.setEditorEnabled(!readOnly);
container = new BeanItemContainer<Record>(Record.class);
grid.setContainerDataSource(container);
grid.setColumns("entityName", "attributeName", "xpath");
HeaderRow filterRow = grid.appendHeaderRow();
addColumn("entityName", filterRow);
addColumn("attributeName", filterRow);
ComboBox combo = new ComboBox();
combo.addValueChangeListener(e->saveXPathSettings());
combo.setWidth(100, Unit.PERCENTAGE);
combo.setImmediate(true);
combo.setNewItemsAllowed(true);
combo.setInvalidAllowed(true);
combo.setTextInputAllowed(true);
combo.setScrollToSelectedItem(true);
combo.setFilteringMode(FilteringMode.CONTAINS);
grid.getColumn("xpath").setEditorField(combo).setExpandRatio(1);
addShowPopulatedFilter("xpath", filterRow);
grid.setEditorBuffered(false);
addComponent(grid);
setExpandRatio(grid, 1);
}
示例13: bindComboBox
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
public <L> ComboBox bindComboBox(AbstractLayout form, ValidatingFieldGroup<E> fieldGroup, String fieldName,
String fieldLabel, Collection<?> options)
{
ComboBox field = new SplitComboBox(fieldLabel, options);
field.setNewItemsAllowed(false);
field.setNullSelectionAllowed(false);
field.setTextInputAllowed(true);
field.setWidth(STANDARD_COMBO_WIDTH);
field.setPopupWidth("100%");
field.setImmediate(true);
form.addComponent(field);
addValueChangeListeners(field);
doBinding(group, fieldName, field);
return field;
}
示例14: ReportParameterReportChooser
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
*
* @param caption
* @param defaultValue
* @param parameterName
* @param enumClass
*/
public ReportParameterReportChooser(String caption, T defaultValue, String parameterName, Class<T> enumClass)
{
super(caption, parameterName);
field = new ComboBox(caption);
this.enumClass = enumClass;
field.setContainerDataSource(FormHelper.createContainerFromEnumClass("value", enumClass));
field.setNewItemsAllowed(false);
field.setNullSelectionAllowed(false);
field.setTextInputAllowed(false);
field.setValue(defaultValue);
}
示例15: ReportParameterEnum
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
*
* @param caption
* @param defaultValue
* @param parameterName
* @param enumClass
*/
public ReportParameterEnum(String caption, T defaultValue, String parameterName, Class<T> enumClass)
{
super(caption, parameterName);
field = new ComboBox(caption);
this.enumClass = enumClass;
field.setContainerDataSource(FormHelper.createContainerFromEnumClass("value", enumClass));
field.setNewItemsAllowed(false);
field.setNullSelectionAllowed(false);
field.setTextInputAllowed(false);
field.setValue(defaultValue);
}