public void setTextInputAllowed(boolean textInputAllowed) { this.field.setTextInputAllowed(textInputAllowed); }
/** * Set whether is possible to input text into the field. If the concrete select component does not support user * input, this method has no effect. * @param textInputAllowed true to allow entering text, false to just show the current selection */ public void setTextInputAllowed(boolean textInputAllowed) { if (getInternalField() instanceof ComboBox) { ((ComboBox) getInternalField()).setTextInputAllowed(textInputAllowed); } }
/** * Set whether is possible to input text into the field. If the concrete select component does not support user * input, this method has no effect. * @param textInputAllowed true to allow entering text, false to just show the current selection */ public void setTextInputAllowed(boolean textInputAllowed) { if (getInternalField() instanceof ComboBox) { ((ComboBox<?>) getInternalField()).setTextInputAllowed(textInputAllowed); } }
@Override protected Component initContent() { Component component = super.initContent(); range.setTextInputAllowed(false); range.setItemCaptionGenerator(item -> { switch (item) { case ALL: return allCaption; case RED: return redCaption; case GREEN: return greenCaption; case BLUE: return blueCaption; } return null; }); return component; }
public FilterField( final ListDataProvider<T> dataProvider, final TableDefinition<T> tableDefinition) { super(); this.dataProvider = dataProvider; this.tableDefinition = tableDefinition; this.attributeField.setStyleName("filter-attribute"); this.attributeField.addValueChangeListener(this::onAttributeChange); this.attributeField.setDataProvider(new ListDataProvider<>(filterDefinitions)); this.attributeField.setTextInputAllowed(false); this.optionsField.setStyleName("filter-options"); this.optionsField.setDataProvider(optionsDataProvider); this.textField.setStyleName("filter-text"); this.tableDefinition.getFilterableColumns().map(ColumnDefinition::filterDefinition).forEach(filterDefinitions::add); if (hasFilterDefinitions()) { this.attributeField.setSelectedItem(this.filterDefinitions.get(0)); } this.optionsField.addValueChangeListener(this::onFilterOptionSelected); this.optionsField.addShortcutListener(new ClearFilterShortcutListener<>(this)); this.textField.addShortcutListener(new FilterShortcutListener<>(this)); this.textField.addShortcutListener(new ClearFilterShortcutListener<>(this)); }
/** * Combo box to pick the time zone offset. */ private void createMaintenanceTimeZoneControl() { // ComboBoxBuilder cannot be used here, because Builder do // 'comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);' // which interferes our code: 'timeZone.addItems(getAllTimeZones());' timeZone = new ComboBox(); timeZone.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_TIME_ZONE_ID); timeZone.setCaption(i18n.getMessage("caption.maintenancewindow.timezone")); timeZone.addItems(getAllTimeZones()); timeZone.setValue(getClientTimeZone()); timeZone.addStyleName(ValoTheme.COMBOBOX_SMALL); timeZone.setTextInputAllowed(false); timeZone.setNullSelectionAllowed(false); }
/** * Combo box to pick the time zone offset. */ private void createMaintenanceTimeZoneControl() { // ComboBoxBuilder cannot be used here, because Builder do // 'comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);' // which interferes our code: 'timeZone.addItems(getAllTimeZones());' timeZone = new ComboBox(); timeZone.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_TIME_ZONE_ID); timeZone.setCaption(i18n.getMessage("caption.maintenancewindow.timezone")); timeZone.addItems(getAllTimeZones()); timeZone.setValue(getClientTimeZone()); timeZone.addStyleName(ValoTheme.COMBOBOX_SMALL); timeZone.setTextInputAllowed(false); timeZone.setNullSelectionAllowed(false); }
languageSelect.setTextInputAllowed(false); languageSelect.addValueChangeListener(new ValueChangeListener() {
/** * Prepares a combo box.<p> * * @param container the indexed item container * @param captionKey the caption message key * * @return the combo box */ private ComboBox prepareComboBox(IndexedContainer container, String captionKey) { ComboBox result = new ComboBox(CmsVaadinUtils.getWpMessagesForCurrentLocale().key(captionKey), container); result.setTextInputAllowed(true); result.setNullSelectionAllowed(false); result.setWidth("100%"); result.setInputPrompt( Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0)); result.setItemCaptionPropertyId(CAPTION_PROPERTY); result.setFilteringMode(FilteringMode.CONTAINS); return result; } }
/** * Prepares a combo box.<p> * * @param container the indexed item container * @param captionKey the caption message key * * @return the combo box */ private ComboBox prepareComboBox(IndexedContainer container, String captionKey) { ComboBox result = new ComboBox(CmsVaadinUtils.getWpMessagesForCurrentLocale().key(captionKey), container); result.setTextInputAllowed(true); result.setNullSelectionAllowed(false); result.setWidth("100%"); result.setInputPrompt( Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0)); result.setItemCaptionPropertyId(CAPTION_PROPERTY); result.setFilteringMode(FilteringMode.CONTAINS); return result; } }
protected CustomComboBoxField() { comboBox = new ComboBox(); comboBox.setContainerDataSource(getValues()); comboBox.setWidth("100%"); comboBox.setTextInputAllowed(false); comboBox.setNewItemsAllowed(false); comboBox.setNullSelectionAllowed(true); comboBox.setImmediate(true); comboBox.setWriteThrough(true); HorizontalLayout compositionRoot = new HorizontalLayout(); setCompositionRoot(compositionRoot); compositionRoot.addComponent(comboBox); compositionRoot.setExpandRatio(comboBox, 1.0f); compositionRoot.setSpacing(true); compositionRoot.setWidth("100%"); }
@Override protected ComboBox<T> createSelectionField() { final ComboBox<T> select = new ComboBox<>(); select.setScrollToSelectedItem(getDefinition().isScrollToSelectedItem()); select.setEmptySelectionAllowed(getDefinition().isEmptySelectionAllowed()); select.setTextInputAllowed(getDefinition().isTextInputAllowed()); select.setPopupWidth(getDefinition().getPopWidth()); select.setEmptySelectionCaption(getDefinition().getEmptySelectionCaption()); select.setPageLength(getDefinition().getPageLength()); return select; } }
m_viewSelector.setTextInputAllowed(false); m_typeContainer.addLayoutClickListener(new LayoutClickListener() {
vAppThemeField.setTextInputAllowed(false); appThemeField.setEditable(changeThemeEnabled);
m_modeSelect.setTextInputAllowed(false); m_modeSelect.setNullSelectionAllowed(false);
combo.setTextInputAllowed(true); combo.setNullSelectionAllowed(false); combo.setWidth("200px");
this.sortComboBox.setNullSelectionAllowed(false); this.sortComboBox.setNewItemsAllowed(false); this.sortComboBox.setTextInputAllowed(false); this.sortComboBox.setFilteringMode(FilteringMode.OFF); this.sortComboBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
this.sortComboBox.setNullSelectionAllowed(false); this.sortComboBox.setNewItemsAllowed(false); this.sortComboBox.setTextInputAllowed(false); this.sortComboBox.setFilteringMode(FilteringMode.OFF); this.sortComboBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);