private void createDatePickerDialog() { dpDialog = new Dialog(); dpDialog.setHeading(HarvesterUI.CONSTANTS.datePicker()); dpDialog.setIcon(HarvesterUI.ICONS.calendar()); dpDialog.setButtons(""); dpDialog.setResizable(false); dpDialog.setWidth(400); dpDialog.setHeight(250); dpDialog.setLayout(new FitLayout()); dpDialog.setBodyStyleName("pad-text"); dpDialog.setHideOnButtonClick(true); DatePicker datePicker = new DatePicker(); datePicker.setValue(new Date()); datePicker.addListener( Events.Select, new Listener<DatePickerEvent>() { public void handleEvent(DatePickerEvent be) { calendar.setDate(be.getDate()); DateTimeFormat formatter = DateTimeFormat.getFormat("MMMM yyyy"); String result = formatter.format(calendar.getDate()); currentMonthAndYear.setText(result); calendarTaskManager.updateScheduleTasks(); } }); dpDialog.add(datePicker); }
private void initWidget() { initmainpanel(); addfinace.setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.addfinance())); d.setHeading("添加新会员"); d.setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.contact24())); d.setLayout(new RowLayout(Orientation.HORIZONTAL)); d.setButtons(Dialog.YESNO); d.getButtonById(Dialog.YES).setText("添加新会员"); d.getButtonById(Dialog.NO).setText("关闭"); d.getButtonById(Dialog.YES) .setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.contact24())); d.getButtonById(Dialog.YES).addListener(Events.Select, this); d.getButtonById(Dialog.NO).addListener(Events.Select, this); d.add(w, new RowData(1, 1)); d.setSize(607, 373); // d.setAutoHeight(true); // d.setAutoWidth(true); store._LoadComplete(); }