/**
   * OK button event handler.
   *
   * @param e action event
   */
  public void actionPerformed(ActionEvent e) {
    boolean close = false;
    CredentialsStorageService credentialsStorageService =
        SecurityConfigActivator.getCredentialsStorageService();
    String oldMasterPassword = null;

    if (credentialsStorageService.isUsingMasterPassword()) {
      oldMasterPassword = getCurrentPassword();
      if (oldMasterPassword.length() == 0) {
        displayPopupError(
            resources.getI18NString("plugin.securityconfig.masterpassword.MP_CURRENT_EMPTY"));
        return;
      }
      boolean verified = credentialsStorageService.verifyMasterPassword(oldMasterPassword);
      if (!verified) {
        displayPopupError(
            resources.getI18NString(
                "plugin.securityconfig.masterpassword.MP_VERIFICATION_FAILURE_MSG"));
        return;
      }
    }
    // if the callback executes OK, we close the dialog
    if (callback != null) {
      close = callback.execute(oldMasterPassword, getNewPassword());
    }

    if (close) {
      dialog = null;
      dispose();
    }
  }
  /** Builds the dialog. */
  private MasterPasswordChangeDialog() {
    super(SecurityConfigActivator.getCredentialsStorageService().isUsingMasterPassword());

    setTitle(resources.getI18NString("plugin.securityconfig.masterpassword.MP_TITLE"));
    setInfoText(resources.getI18NString("plugin.securityconfig.masterpassword.INFO_TEXT"));

    getOkButton().addActionListener(this);
  }