Exemplo n.º 1
0
 @Override
 public void execute() {
   Date now = new Date();
   Date beginDate = DateUtils.getFirstDayOfYear(now);
   Date endDate = DateUtils.addYears(beginDate, 1);
   applyFilter(beginDate, endDate);
 }
Exemplo n.º 2
0
 @Override
 public void execute() {
   Date now = new Date();
   int qr = DateUtils.getMonth(now) / 3;
   Date beginDate = DateUtils.getFirstDayOfYear(now);
   CalendarUtil.addMonthsToDate(beginDate, 3 * qr);
   Date endDate = CalendarUtil.copyDate(beginDate);
   CalendarUtil.addMonthsToDate(endDate, 3);
   applyFilter(beginDate, endDate);
 }
Exemplo n.º 3
0
 @Override
 public void execute() {
   Date beginDate = CalendarUtil.copyDate(currentValue);
   int month = DateUtils.getMonth(beginDate);
   beginDate = DateUtils.getFirstDayOfYear(beginDate);
   CalendarUtil.addMonthsToDate(beginDate, month);
   Date endDate = CalendarUtil.copyDate(beginDate);
   CalendarUtil.addMonthsToDate(endDate, 1);
   applyFilter(beginDate, endDate);
 }
Exemplo n.º 4
0
 private void createMenu(Date value) {
   popupPanel = new ContextMenuPopupPanel(grid);
   menu = new MenuBar(true);
   menu.setAutoOpen(false);
   menu.addStyleName(ContextMenuPopupPanel.RESOURCES.style().bCellContextMenu());
   menu.addItem(CONSTANTS.lastYr(), lastYearCommand);
   menu.addItem(CONSTANTS.thisYr(), thisYearCommand);
   menu.addItem(CONSTANTS.lastQr(), lastQrCommand);
   menu.addItem(CONSTANTS.thisQr(), thisQrCommand);
   if (value != null) {
     menu.addSeparator();
     menu.addItem(CONSTANTS.inYr(DateUtils.getYear(value)), inYearCommand);
     menu.addItem(
         CONSTANTS.inQrYr(QUARTERS[DateUtils.getMonth(value) / 3], DateUtils.getYear(value)),
         inQrYrCommand);
     menu.addItem(
         CONSTANTS.inMnYr(
             Integer.toString(DateUtils.getMonth(value) + 1), DateUtils.getYear(value)),
         inMnYrCommand);
     menu.addItem(CONSTANTS.date(DateUtils.dateToString(value)), inDayCommand);
   }
   popupPanel.add(menu);
   /*        popupPanel.addCloseHandler(new CloseHandler<PopupPanel>() {
       @Override
       public void onClose(CloseEvent<PopupPanel> event) {
           if (!event.isAutoClosed()) {
               if (lastParent != null) {
                   lastParent.focus();
               }
           }
           lastParent = null;
       }
   });*/
 }