@Override
 protected void internalSaveWidgetValues() {
   super.internalSaveWidgetValues();
   IDialogSettings settings = getDialogSettings();
   String login = Strings.trimToNull(loginField.getText());
   if (settings != null) settings.put(STORE_LOGIN, login);
   if (saveInSecureStoreButton.getSelection())
     saveSecurePassword(login, Strings.emptyToNull(passwordField.getText()));
 }
    public void handleEvent(Event e) {
      if (validationChange)
        // Don't act on events that stems from login/password settings made
        // by the source group validation
        return;

      Widget source = e.widget;
      if (source == saveInSecureStoreButton && saveInSecureStoreButton.getSelection()) {
        String login = Strings.trimToNull(loginField.getText());
        if (login != null) {
          String password = Strings.emptyToNull(passwordField.getText());
          if (password != null) saveSecurePassword(login, password);
        }
      }
      updatePageCompletion();
    }
  private ISecurePreferences getPasswordNode(String login) {
    if (login == null) return null;

    ISecurePreferences preferences = SecurePreferencesFactory.getDefault();
    if (preferences == null) return null;

    String host = Strings.trimToNull(preferenceHelper.getForgeURI());
    if (host == null) return null;

    StringBuilder bld = new StringBuilder();
    bld.append("/Puppetforge Credentials/"); // $NON-NLS-1$
    bld.append(login);
    bld.append('/');
    Checksums.appendSHA1(bld, host);
    return preferences.node(bld.toString());
  }