本文整理汇总了Java中com.vaadin.ui.ComboBox.setImmediate方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.setImmediate方法的具体用法?Java ComboBox.setImmediate怎么用?Java ComboBox.setImmediate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setImmediate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: addComboBoxFilters
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
* Ajoute un filtre en combobox String sur une colonne
*
* @param property
* @param cb
*/
public void addComboBoxFilters(String property, ComboBox cb, String libNull) {
HeaderCell cell = getFilterCell(property);
cb.addValueChangeListener(e -> {
container.removeContainerFilters(property);
if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
&& !((String) cb.getValue()).equals(libNull)) {
container.addContainerFilter(new SimpleStringFilter(property, (String) cb.getValue(), true, true));
} else if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
&& ((String) cb.getValue()).equals(libNull)) {
container.addContainerFilter(new IsNull(property));
}
fireFilterListener();
fireFilterListener();
});
cb.setImmediate(true);
cb.setWidth(100, Unit.PERCENTAGE);
cb.addStyleName(ValoTheme.COMBOBOX_TINY);
cell.setComponent(cb);
}
示例4: 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;
}
示例5: buildMainLayout
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// comboBox
comboBox = new ComboBox();
comboBox.setImmediate(false);
comboBox.setWidth("-1px");
comboBox.setHeight("-1px");
mainLayout.addComponent(comboBox);
// treeExpression
treeExpression = new Tree();
treeExpression.setImmediate(false);
treeExpression.setWidth("100.0%");
treeExpression.setHeight("-1px");
mainLayout.addComponent(treeExpression);
mainLayout.setExpandRatio(treeExpression, 1.0f);
return mainLayout;
}
示例6: setFieldDefaults
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void setFieldDefaults(ComboBox backingField) {
backingField.setImmediate(true);
backingField.removeAllItems();
for (Object p : backingField.getContainerPropertyIds()) {
backingField.removeContainerProperty(p);
}
// setup displaying property ids
backingField.addContainerProperty(CAPTION_PROPERTY_ID, String.class, "");
backingField.setItemCaptionPropertyId(CAPTION_PROPERTY_ID);
@SuppressWarnings("unchecked")
EnumSet<?> enumSet = EnumSet.allOf((Class<java.lang.Enum>) getTargetPropertyType());
for (Object r : enumSet) {
Item newItem = backingField.addItem(r);
newItem.getItemProperty(CAPTION_PROPERTY_ID).setValue(r.toString());
}
}
示例7: 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");
}
示例8: createLanguageSelector
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createLanguageSelector() {
ComboBox languageSelector = new ComboBox("com.vaadin.demo.dashboard.DashboardUI.Language");
languageSelector.setImmediate(true);
languageSelector.setNullSelectionAllowed(false);
addLocale(Locale.ENGLISH, languageSelector);
addLocale(Locale.FRENCH, languageSelector);
addLocale(new Locale("es"), languageSelector);
// languageSelector.setValue(I18NStaticService.getI18NServive().getLocale());
/*-languageSelector.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
Locale locale = (Locale) (event.getProperty().getValue());
I18NStaticService.getI18NServive().setLocale(locale);
getUI().requestRepaintAll();
}
});*/
return languageSelector;
}
示例9: buildMainLayout
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("100%");
mainLayout.setHeight("100%");
mainLayout.setMargin(false);
// top-level component properties
setWidth("100.0%");
setHeight("100.0%");
// comboBox_1
defaultLocaleField = new ComboBox();
defaultLocaleField.setImmediate(false);
defaultLocaleField.setWidth("100.0%");
defaultLocaleField.setHeight("-1px");
mainLayout.addComponent(defaultLocaleField);
return mainLayout;
}
示例10: 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;
}
示例11: 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;
}
示例12: buildHorizontalLayout_1
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
// common part: create layout
horizontalLayout_1 = new HorizontalLayout();
horizontalLayout_1.setImmediate(false);
horizontalLayout_1.setWidth("-1px");
horizontalLayout_1.setHeight("-1px");
horizontalLayout_1.setMargin(false);
horizontalLayout_1.setSpacing(true);
// comboBoxMin
comboBoxMin = new ComboBox();
comboBoxMin.setCaption("Minimum Type");
comboBoxMin.setImmediate(true);
comboBoxMin.setDescription("Select the type for the minimum.");
comboBoxMin.setWidth("-1px");
comboBoxMin.setHeight("-1px");
horizontalLayout_1.addComponent(comboBoxMin);
// textFieldMin
textFieldMin = new TextField();
textFieldMin.setCaption("Minimum Value");
textFieldMin.setImmediate(true);
textFieldMin.setDescription("Enter a value for the minimum.");
textFieldMin.setWidth("-1px");
textFieldMin.setHeight("-1px");
textFieldMin.setInvalidAllowed(false);
textFieldMin.setInputPrompt("eg. 1");
horizontalLayout_1.addComponent(textFieldMin);
horizontalLayout_1
.setComponentAlignment(textFieldMin, new Alignment(9));
return horizontalLayout_1;
}
示例13: buildHorizontalLayout_2
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
// common part: create layout
horizontalLayout_2 = new HorizontalLayout();
horizontalLayout_2.setImmediate(false);
horizontalLayout_2.setWidth("-1px");
horizontalLayout_2.setHeight("-1px");
horizontalLayout_2.setMargin(false);
horizontalLayout_2.setSpacing(true);
// comboBoxMax
comboBoxMax = new ComboBox();
comboBoxMax.setCaption("Maximum Type");
comboBoxMax.setImmediate(true);
comboBoxMax.setDescription("Select the type for the maximum.");
comboBoxMax.setWidth("-1px");
comboBoxMax.setHeight("-1px");
horizontalLayout_2.addComponent(comboBoxMax);
// textFieldMax
textFieldMax = new TextField();
textFieldMax.setCaption("Maximum Value");
textFieldMax.setImmediate(true);
textFieldMax.setDescription("Enter a value for the maxmum.");
textFieldMax.setWidth("-1px");
textFieldMax.setHeight("-1px");
textFieldMax.setInvalidAllowed(false);
textFieldMax.setInputPrompt("eg. 100");
horizontalLayout_2.addComponent(textFieldMax);
return horizontalLayout_2;
}
示例14: buildMainLayout
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(false);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// comboBoxCategories
comboBoxCategories = new ComboBox();
comboBoxCategories.setCaption("Select A Category");
comboBoxCategories.setImmediate(false);
comboBoxCategories.setWidth("-1px");
comboBoxCategories.setHeight("-1px");
comboBoxCategories.setInvalidAllowed(false);
comboBoxCategories.setRequired(true);
mainLayout.addComponent(comboBoxCategories);
mainLayout.setExpandRatio(comboBoxCategories, 1.0f);
// horizontalLayout_2
horizontalLayout_2 = buildHorizontalLayout_2();
mainLayout.addComponent(horizontalLayout_2);
mainLayout.setExpandRatio(horizontalLayout_2, 1.0f);
return mainLayout;
}
示例15: buildHorizontalLayout_2
import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
// common part: create layout
horizontalLayout_2 = new HorizontalLayout();
horizontalLayout_2.setImmediate(false);
horizontalLayout_2.setWidth("-1px");
horizontalLayout_2.setHeight("-1px");
horizontalLayout_2.setMargin(false);
horizontalLayout_2.setSpacing(true);
// comboBoxCategoryFilter
comboBoxCategoryFilter = new ComboBox();
comboBoxCategoryFilter.setCaption("Filter Category");
comboBoxCategoryFilter.setImmediate(false);
comboBoxCategoryFilter.setWidth("-1px");
comboBoxCategoryFilter.setHeight("-1px");
horizontalLayout_2.addComponent(comboBoxCategoryFilter);
horizontalLayout_2.setExpandRatio(comboBoxCategoryFilter, 1.0f);
// buttonNewAttribute
buttonNewAttribute = new Button();
buttonNewAttribute.setCaption("New Attribute");
buttonNewAttribute.setImmediate(true);
buttonNewAttribute
.setDescription("Click to create a new attribute in the dictionary.");
buttonNewAttribute.setWidth("-1px");
buttonNewAttribute.setHeight("-1px");
horizontalLayout_2.addComponent(buttonNewAttribute);
horizontalLayout_2.setComponentAlignment(buttonNewAttribute,
new Alignment(10));
return horizontalLayout_2;
}