示例#1
0
  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);
  }
示例#2
0
 /**
  * Sets the menu's date.
  *
  * @param date the date
  */
 public void setDate(Date date) {
   picker.setValue(date);
 }
示例#3
0
 /**
  * Returns the selected date.
  *
  * @return the date
  */
 public Date getDate() {
   return picker.getValue();
 }
示例#4
0
 @Override
 public void focus() {
   super.focus();
   picker.getElement().focus();
 }