示例#1
0
  LayoutContainer initProButtons() {

    TableLayout tl = new TableLayout(2);
    lc.setLayout(tl);

    TableData td1 = new TableData();
    td1.setColspan(1);
    TableData td2 = new TableData();
    td2.setColspan(2);

    bsd_add =
        new BcodeSelectDialog<TreeNodeModelData>() {
          public void doposted(List<TreeNodeModelData> modeldatalist) {
            if (modeldatalist.size() > 0) {
              this.setEmptyText("已经选择了数据");

              List<TreeNodeModelData> selectchecklist = bsd_add.getTree().getCheckedSelection();

              if (selectchecklist.size() <= 0) {
                MessageBox.alert("错误", "请选择“离职人员”", null);
                return;
              }
              String bcodestr = "";
              for (TreeNodeModelData tnmd : selectchecklist) {
                BusiObject bo = new BusiObject();

                bcodestr += " systembcode like '" + tnmd.get("systembcode") + "%25' or ";
              }
              bcodestr += " 1=2";
              GWT.log("bcodestr =" + bcodestr);

              String sql =
                  "select icode, bcode,employstatus,leavereason,leavemark,Resignationdate from bcode_job where exists (select * from systembcode_view where systembcode_view.bcode = bcode_job.bcode  and ( "
                      + bcodestr
                      + "))";
              GWT.log("sql =" + sql);
              store.getStoreinfo().setSql(sql);
              store.reload();
            }
          }
        };
    bsd_add.setNeesreselect(false);
    bsd_add.setEmptyText("未选择数据");
    bsd_add.setExpanded();
    bsd_add.setCheckNodes(CheckNodes.BOTH);

    Resignationdate = new DateField();
    Resignationdate.getPropertyEditor().setFormat(DateTimeFormat.getFormat("yyyy-MM-dd"));

    save.addListener(Events.OnClick, getListener());
    lc.add(new LabelField("选择人员:"), td1);
    lc.add(bsd_add, td1);

    lc.add(new LabelField("状态改变为:"), td1);
    lc.add(C_num8, td1);

    lc.add(leavereason_l, td1);
    lc.add(C_num9, td1);

    lc.add(resignationdate_l, td1);
    lc.add(Resignationdate, td1);

    lc.add(mark_l, td1);
    lc.add(mark_t, td1);

    leavereason_l.setVisible(false);
    C_num9.setVisible(false);
    mark_l.setVisible(false);
    mark_t.setVisible(false);
    resignationdate_l.setVisible(false);
    Resignationdate.setVisible(false);

    lc.add(save, td2);

    bsd_add.addListener(Events.Changed, getListener());
    C_num8.addListener(Events.Changed, getListener());
    C_num9.addListener(Events.Changed, getListener());
    mark_t.addListener(Events.Changed, getListener());
    Resignationdate.addListener(Events.Changed, getListener());
    return lc;
  }
  private TextArea getCommandLineTextArea() {
    if (txtrEnterTheCommand == null) {
      txtrEnterTheCommand = new TextArea();
      txtrEnterTheCommand.setFieldLabel("Enter the command to run");
      txtrEnterTheCommand.setAllowBlank(false);
      txtrEnterTheCommand.addListener(
          Events.KeyUp,
          new Listener<BaseEvent>() {

            public void handleEvent(BaseEvent be) {

              String text = txtrEnterTheCommand.getValue();
              String exe;
              if (text == null) {
                exe = "";
              } else {
                int firstWhitespace = text.indexOf(" ");
                if (firstWhitespace == -1) {
                  exe = text;
                } else {
                  exe = text.substring(0, firstWhitespace);
                }
              }

              if (lastCalculatedExecutable != null && lastCalculatedExecutable.equals(exe)) {
                return;
              }

              final String executable = exe;
              lastCalculatedExecutable = exe;

              suggestJobname();

              if (exe.length() == 0) {
                lastCalculatedExecutable = null;
                setStatus("No executable specified.");
                setAppNotAvailable();
                return;
              }

              setStatus("Trying to find application(s) for executable: " + executable);

              GrisuClientService.Util.getInstance()
                  .getApplicationForExecutable(
                      exe,
                      new AsyncCallback<String[]>() {

                        public void onFailure(Throwable arg0) {
                          getApplicationPanel().setHeading("Application");
                          arg0.printStackTrace();
                        }

                        public void onSuccess(String[] arg0) {

                          if (arg0.length == 0) {
                            setStatus("Could not find application for executable: " + executable);
                            setAppNotAvailable();
                            return;
                          }

                          if (arg0.length > 1) {
                            setStatus(
                                "Found more than one application for executable: "
                                    + executable
                                    + ". Please contact [email protected] and tell them to bloody fix this.");
                            // return;
                          }

                          setStatus(
                              "Found "
                                  + arg0.length
                                  + " applications for executable "
                                  + executable
                                  + ". Getting Versions...");

                          setCurrentApplication(arg0);

                          fillVersionsComboBox();
                        }
                      });
            }
          });
    }
    return txtrEnterTheCommand;
  }