/** 发布范围按钮侦听器 */
  private void deptNameStrTextListener() {
    deptNameStrText.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            PageControllerInstance pageControllerInstance =
                new PageControllerInstance(
                    new PageController(
                        DepartmentSelectProcessor.class, DepartmentSelectRender.class),
                    deptGuidStr);
            WindowStyle windowStyle = new WindowStyle(JWT.CLOSE, Location.Context);
            windowStyle.setSize(240, 360);
            MsgRequest request = new MsgRequest(pageControllerInstance, "部门选择", windowStyle);
            request.setResponseHandler(
                new ResponseHandler() {

                  public void handle(
                      Object type, Object deptNameStr, Object deptGuidStr, Object returnValue3) {
                    if (type.equals(DepartmentSelectProcessor.FINISH_SELECTED)) { // 完成选择
                      NewNoticeProcessor.this.deptNameStrText.setText(
                          getOmitDeptNameStr(deptNameStr.toString()));
                      NewNoticeProcessor.this.deptGuidStr =
                          null != deptGuidStr ? deptGuidStr.toString() : "";
                    }
                  }
                });
            getContext().bubbleMessage(request);
          }
        });
  }
  /** 搜索按钮增加事件监听器 */
  protected void searchNoticeButtonListenter() {
    searchNoticeText.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            table.render();
          }
        });
  }
  @Override
  public void process(Situation situation) {
    super.process(situation);
    queryTermList = this.createControl(ID_COMBOLIST_DATEITEM, LWComboList.class);
    PSIProcessorUtils.initQueryTermSource(queryTermList);
    queryTermList.addSelectionListener(
        new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            table.render();
          }
        });

    countLabel = this.createControl(ID_LABEL_CHECKOUTGINSHEET_COUNT, Label.class);

    searchText = this.createControl(ID_TEXT_SEARCH, Text.class);
    searchText.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            table.render();
          }
        });
  }
  @Override
  public void process(Situation situation) {

    super.process(situation);
    LoginInfo login = situation.find(LoginInfo.class);

    final LWComboList cmb_scope = this.createControl(ID_COMBO_CUSTOMERSCOPE, LWComboList.class);
    // final ComboList cmb_term = this.createControl(ID_COMBO_TIME,
    // ComboList.class);
    final QueryScopeSource source =
        PSIProcessorUtils.initQueryScopeSource(cmb_scope, "我的客户", "全部客户", Auth.Sales);
    // getContext().getList(QueryTerm.class);
    // cmb_term.addItem("当前");
    // cmb_term.setData("当前", "");
    // cmb_term.addItem("本月新增");
    // cmb_term.setData("本月新增", QueryTerm.ID_MONTH);
    // cmb_term.addItem("本季新增");
    // cmb_term.setData("本季新增", QueryTerm.ID_QUARTER);
    // cmb_term.addItem("本周新增");
    // cmb_term.setData("本周新增", QueryTerm.ID_WEEK);
    // cmb_term.setSelection(0);
    // cmb_term.addSelectionListener(new SelectionListener() {
    //
    // public void widgetSelected(SelectionEvent e) {
    // key.setQueryTerm(getContext().find(QueryTerm.class,
    // cmb_term.getData(cmb_term.getText())));
    // table.render();
    // }
    // });

    cmb_scope.addSelectionListener(
        new SelectionListener() {

          public void widgetSelected(SelectionEvent e) {
            key.setQueryScope((QueryScope) source.getElementById(cmb_scope.getText()));
            key.setSearchText(null);
            table.render();
          }
        });

    countLabel = this.createControl(ID_LABEL_COUNT, Label.class);

    this.createControl(ID_BUTTON_NEW, Button.class)
        .addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                PageControllerInstance pci = new PageControllerInstance("NewCustomerPage");
                MsgRequest request = new MsgRequest(pci);
                getContext().bubbleMessage(request);
              }
            });
    Button but_allocate = this.createControl(ID_BUTTON_ALLOCATE, Button.class, JWT.NONE);
    but_allocate.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            allocate(table.getSelections());
          }
        });
    if (!login.hasAuth(Auth.SubFunction_CustomerMange_BusPerson)) {
      but_allocate.getNext().dispose();
      but_allocate.dispose();
    }
    Button but_share = this.createControl(ID_BUTTON_SHARE, Button.class, JWT.NONE);
    but_share.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            share(table.getSelections());
          }
        });
    if (!login.hasAuth(Auth.SubFunction_CustomerMange_Share)) {
      but_share.getNext().dispose();
      but_share.dispose();
    }

    this.createControl(ID_BUTTON_DELETE, Button.class)
        .addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                delete(table.getSelections());
              }
            });
    final Text searchText = this.createControl(ID_TEXT_SEARCHTEXT, Text.class, JWT.NONE);
    searchText.addActionListener(
        new ActionListener() {

          public void actionPerformed(ActionEvent e) {
            key.setSearchText(searchText.getText());
            table.render();
          }
        });
  }