private ComboBox createLocaleSelect() { ComboBox s = new ComboBox("Locale"); s.addContainerProperty("caption", String.class, ""); s.setItemCaptionPropertyId("caption"); s.setFilteringMode(FilteringMode.CONTAINS); for (Locale l : Locale.getAvailableLocales()) { if (!s.containsId(l)) { Item i = s.addItem(l); i.getItemProperty("caption").setValue(getLocaleItemCaption(l)); } } s.select(getLocale()); s.setImmediate(true); s.addValueChangeListener( new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { updateCalendarLocale((Locale) event.getProperty().getValue()); } }); return s; }
private ComboBox createTimeZoneSelect() { ComboBox s = new ComboBox("Timezone"); s.addContainerProperty("caption", String.class, ""); s.setItemCaptionPropertyId("caption"); s.setFilteringMode(FilteringMode.CONTAINS); Item i = s.addItem(DEFAULT_ITEMID); i.getItemProperty("caption").setValue("Default (" + TimeZone.getDefault().getID() + ")"); for (String id : TimeZone.getAvailableIDs()) { if (!s.containsId(id)) { i = s.addItem(id); i.getItemProperty("caption").setValue(id); } } if (testBench) { s.select("America/New_York"); } else { s.select(DEFAULT_ITEMID); } s.setImmediate(true); s.addValueChangeListener( new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { updateCalendarTimeZone(event.getProperty().getValue()); } }); return s; }