/**
   * 通过过滤条件获得相应的消息
   *
   * @throws Exception
   */
  @SuppressWarnings("unchecked")
  public void retrieveData() throws Exception {

    List input = (List) tv.getInput();
    if (input != null) {
      input.clear();
    }

    MessageService ms = AppContext.getInstance().getMessageService();
    List<Message> list_messages = null;
    if (executeMethod.getText().equals("查询所有")) {
      list_messages = ms.getAllMessages();
    } else {
      list_messages =
          ms.getMessages(
              executeSender.getText(),
              executeReceiver.getText(),
              beginDateText.getDate(),
              endDateText.getDate());
    }

    if (list_messages != null && !list_messages.isEmpty()) {
      for (Message msg : list_messages) {
        DeptMessageTableViewLabelProvider dp = new DeptMessageTableViewLabelProvider(msg);
        input.add(dp);
      }
    } else {
      MessageUtil.ShowHintMessage(getShell(), "没有查询到数据!");
    }

    tv.setInput(input);
  }
Пример #2
0
 protected void okPressed() {
   String str = txtCoastingTime.getText();
   if (str.matches("[0-9]+")) {
     try {
       if (!(Integer.valueOf(str)).equals(CoastingTime)) {
         //					AppContext.getInstance().getSystemService().saveSlideTime(
         //							Integer.valueOf(str));
         close();
       }
     } catch (Exception e) {
       MessageUtil.ShowErroMessage(
           this.getShell(), "保存数据时出现异常,请联系系统维护人员!\n异常信息:" + e.getMessage());
       OwnerLog.writeExceptionLog(e);
     }
   } else {
     MessageUtil.ShowErroMessage(this.getShell(), "请输入有效正整数!");
   }
 }
Пример #3
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite comp = (Composite) super.createDialogArea(parent);
    Composite topComp = new Composite(comp, SWT.NONE);
    GridLayout layout = new GridLayout(3, true);
    topComp.setLayout(layout);
    AdvancedWidgetCreator.createNewContentLabel(topComp, 1, 9).setText("滑行时间");
    txtCoastingTime = AdvancedWidgetCreator.createNewContentText(topComp, 1, 120, SWT.BORDER);

    AdvancedWidgetCreator.createNewContentLabel(topComp, 1, -1).setText("分钟");

    try {
      //			CoastingTime = AppContext.getInstance().getSystemService()
      //					.getSlideTime();
    } catch (Exception e) {
      MessageUtil.ShowErroMessage(this.getShell(), "数据获取出错,请联系系统维护人员!\n异常信息:" + e.getMessage());
      OwnerLog.writeExceptionLog(e);
    }
    txtCoastingTime.setText(CoastingTime + "");
    return topComp;
  }