@Override
  public KeyEventFeedback execute() throws LogicException {
    KeyEventFeedback fb;
    ViewType viewState;
    String msg = "";

    cBag.toggleView();
    viewState = cBag.getView();

    switch (viewState) {
      case COMPLETED:
        msg = USR_MSG_VIEW_COMPLETE;
        break;

      case INCOMPLETE:
        msg = USR_MSG_VIEW_INCOMPLETE;
        break;

      case DEFAULT:
        msg = USR_MSG_VIEW_TODAY;
        break;
    }

    fb = new KeyEventFeedback(cBag, cKey, msg);
    return fb;
  }
示例#2
0
 @Override
 public CommandFeedback execute() {
   String msg = "";
   switch (cViewBy) {
     case COMPLETED:
       msg = USR_MSG_VIEW_COMPLETE;
       cBag.setView(ViewType.COMPLETED);
       break;
     case INCOMPLETE:
       msg = USR_MSG_VIEW_INCOMPLETE;
       cBag.setView(ViewType.INCOMPLETE);
       break;
     case DEFAULT:
       msg = USR_MSG_VIEW_TODAY;
       cBag.setView(ViewType.DEFAULT);
       break;
     default:
       assert false;
       break;
   }
   return new CommandFeedback(cCommand, cBag, msg);
 }