public DateMenu() { picker = new DatePicker(); picker.addValueChangeHandler( new ValueChangeHandler<Date>() { @Override public void onValueChange(ValueChangeEvent<Date> event) { onPickerSelect(event); } }); add(picker); getAppearance().applyDateMenu(getElement()); plain = true; showSeparator = false; setEnableScrolling(false); }
/** * Sets the menu's date. * * @param date the date */ public void setDate(Date date) { picker.setValue(date); }
/** * Returns the selected date. * * @return the date */ public Date getDate() { return picker.getValue(); }
@Override public void focus() { super.focus(); picker.getElement().focus(); }