Пример #1
0
  private int dof1(KeyEvent evt) {
    final ClientTask task = new TaskSelectFieldDescription(fieldName, projectId);
    task.setCallback(
        new Runnable() {

          public void run() {
            try {
              String description = (String) task.getResult();
              String desc = "";
              String fieldDescription = "";
              StringTokenizer Tok = new StringTokenizer(description);
              while (Tok.hasMoreTokens()) {
                desc = desc + " " + Tok.nextToken();
                if (desc.length() >= 45) {
                  fieldDescription = fieldDescription + "\n" + desc;
                  desc = "";
                }
              }
              fieldDescription = fieldDescription + "\n" + desc;
              String dialogm = "HELP TEXT FOR  " + fieldName;
              Component parent = task.getParent();

              JOptionPane.showMessageDialog(
                  parent, fieldDescription, dialogm, JOptionPane.INFORMATION_MESSAGE);
            } catch (Throwable th) {
              Log.quit(th);
            }
          }
        });
    task.enqueue();

    return 0;
  }
Пример #2
0
  /** Get the user record */
  private void getUserData() {
    teamsModel = new QueryComboModel("get teams names");
    teamsCombo = new LComboBox(40);
    teamsCombo.setModel(teamsModel);

    if (usersId > 0) {
      final ClientTask task;
      // Log.print("(AddEditUsers.getUserData) " + usersId);
      task = new TaskExecuteQuery("users by id select", Integer.toString(usersId));
      task.setCallback(
          new Runnable() {

            public void run() {
              getUserByIdDataEntry((ResultSet) task.getResult());
              // set OK disabled again
              // (It was enabled by getUserByDataEntry when combo selection set.)
              okButton.setEnabled(false);
            }
          });
      boolean ok = task.enqueue(this);
    }
    addControls();
  }