コード例 #1
0
  /** Handles the Join button. */
  private void doJoin() {
    if (mInProgress) return;

    mInProgress = true;

    // Store field values in preferences
    saveFieldValues();

    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    MakeTableWindow maker = new MakeTableWindow(mOwner, mConnection, this);
    maker.joinTable(
        mInvite.getTableJID(),
        mNicknameField.getText(),
        new MakeTableWindow.TableWindowCallback() {
          public void fail() {
            mInProgress = false;
            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
          }

          public void succeed(TableWindow win) {
            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            dispose();
          }
        });
  }
コード例 #2
0
  /** Saves the current text of the fields to the preferences storage. */
  private void saveFieldValues() {
    Preferences prefs = Preferences.userNodeForPackage(getClass()).node(NODENAME);

    prefs.put(NICKNAME_KEY, mNicknameField.getText());
  }