コード例 #1
0
  private void gridChange(Object itemId) {
    Collection<Object> ids = (Collection<Object>) gridFilter.getGrid().getValue();

    Button btnCheck = (Button) commandbar.getButton(COMMAND.CHECK.getValue());
    Button btnFavorite = (Button) commandbar.getButton(COMMAND.POP_MY_FAVORITE.getValue());
    Button btnCompare = (Button) commandbar.getButton(COMMAND.COMPARE.getValue());

    if (ids.size() != 0) {
      btnCompare.setEnabled(true);

      List<Item> selection = gridFilter.getGrid().getSelection();
      // 選擇多筆時, 只有btnCompare有可能Enabeld
      if (selection.size() > 1) {
        menu.setMenuBarEnabled(false);
        btnCheck.setEnabled(false);
        btnFavorite.setEnabled(false);
      } else {
        menu.setMenuBarEnabled(true);
        btnCheck.setEnabled(true);
        btnFavorite.setEnabled(true);
      }
      // 沒選到任何資料時
    } else {
      menu.setMenuBarEnabled(false);
      btnCheck.setEnabled(false);
      btnFavorite.setEnabled(false);
      btnCompare.setEnabled(false);
    }
  }
コード例 #2
0
 private void perform(String instruction) {
   if (instruction.equals(COMMAND.CHECK.getValue())) {
     check(instruction);
   } else if (instruction.equals(COMMAND.POP_MY_FAVORITE.getValue())) {
     popMyFavorite(instruction);
   } else if (instruction.equals(COMMAND.SAVE_MY_FAVORITE.getValue())) {
     saveMyFavorite();
   } else if (instruction.equals(COMMAND.CLOSE_MY_FAVORITE.getValue())) {
     closeMyFavorite();
   } else if (instruction.equals(COMMAND.COMPARE.getValue())) {
     compare();
   } else if (instruction.equals(COMMAND.RESET.getValue())) {
     refresh();
   }
 }
コード例 #3
0
  private void compare() {
    String instruction = COMMAND.COMPARE.getValue();

    Map<String, Object> data = new HashMap<>();

    List<Item> selection = grid.getSelection();

    if (selection.size() == 0) {
      Messagebox.hint(messageResource.getMessage("100003"));
      return;
    }

    data.put("items", selection);

    CommandEvent.ExecuteEvent event = CommandEvent.createExecuteEvent(this, instruction, data);
    fireEvent(event);

    //		for(int i = 1601 ; i< 2100 ; i++) {
    //			String numberName = String.format("%04d", i);
    //			System.out.println(numberName);
    //
    //
    //			CandApplyRequisition bean=new CandApplyRequisition();
    //			Candidate candidate=candidateService.findOneByEmail("Julia"+numberName+"@gmail.com");
    //			bean.setApplyDate(new DateTime(2015,5,24,0,0,0).toDate() );
    //			bean.setCandidate(candidate);
    //			bean.setRequisition(requisitionService.findOneByNo("MTK120150519002"));
    //			bean.setStage("02");
    //
    //		    CandStageInterviewer stageInterviewer=new CandStageInterviewer();
    //		    stageInterviewer.setInterviewer(accountService.findOneByUsername("MTK05756"));
    //		    stageInterviewer.setStage(Stage.RESUMEREVIEW.getValue());
    //		    stageInterviewer.setStartDate(new DateTime(2015,11,17,0,0,0).toDate());
    //	            stageInterviewer.setDueDate(new DateTime(2015,11,19,0,0,0).toDate());
    //		    bean.addStageInterviewer(stageInterviewer);
    //		    candApplyRequisitionService.save(bean);
    //		}
  }