/** * Constructs an empty combo box, whose content can be set with * {@link #setDataProvider(DataProvider)} or {@link #setItems(Collection)}. * * @param caption * the caption to show in the containing layout, null for no * caption */ public ComboBox(String caption) { this(); setCaption(caption); }
spUICombo.setCaption(caption);
spUICombo.setCaption(caption);
ComboBox accountStatusChoice = new ComboBox(); accountStatusChoice.setCaption(MessageResource.getLocalizedString("caption.accountStatus")); accountStatusChoice.setRequired(true); accountStatusChoice.setRequiredError(MessageResource.getLocalizedString("error.required.accountStatus")); accountStatusChoice.setImmediate(true); for (AccountStatus accountStatus : AccountStatus.values()) { accountStatusChoice.addItem(accountStatus); accountStatusChoice.setItemCaption(accountStatus, MessageResource.getLocalizedString(accountStatus.name())); } return accountStatusChoice;
/** * @return a new ComboBox */ public ComboBox buildCombBox() { final ComboBox comboBox = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false, "", prompt); comboBox.setImmediate(true); comboBox.setPageLength(7); comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME); comboBox.setSizeUndefined(); if (caption != null) { comboBox.setCaption(caption); } if (id != null) { comboBox.setId(id); } if (valueChangeListener != null) { comboBox.addValueChangeListener(valueChangeListener); } return comboBox; } }
/** * @return a new ComboBox */ public ComboBox buildCombBox() { final ComboBox comboBox = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false, "", prompt); comboBox.setImmediate(true); comboBox.setPageLength(7); comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME); comboBox.setSizeUndefined(); if (caption != null) { comboBox.setCaption(caption); } if (id != null) { comboBox.setId(id); } if (valueChangeListener != null) { comboBox.addValueChangeListener(valueChangeListener); } return comboBox; } }
/** * 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); }
languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ComboBox languageSelect = new ComboBox(); languageSelect.setCaption(m_messages.key(Messages.GUI_LANGUAGE_SWITCHER_LABEL_0)); languageSelect.setNullSelectionAllowed(false);
localeSelectors.addStyleName(OpenCmsTheme.SITEMAP_LOCALE_BAR); m_rootLocaleSelector.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_MAIN_LOCALE_0)); m_comparisonLocaleSelector.setCaption( CmsVaadinUtils.getMessageText(Messages.GUI_LOCALECOMPARE_COMPARISON_LOCALE_0));
m_copyMode.setValue(CmsContainerPageCopier.CopyMode.automatic); form.addComponent(m_copyMode); m_copyMode.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_COPYPAGE_COPY_MODE_0)); return form;
m_modeSelect.setCaption(m_messages.key(Messages.GUI_VIEW_SWITCHER_LABEL_0));
field.setCaption(getCaptionFromId(propertyId)); formatField(propertyId, field).bind(propertyId); return field;
m_actionCombo.setCaption(CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_COPYPAGE_COPY_MODE_0)); m_actionCombo.setNullSelectionAllowed(false); m_actionCombo.setNewItemsAllowed(false);