Search in sources :

Example 6 with SimpleCredentialsStorage

use of org.archicontribs.modelrepository.authentication.SimpleCredentialsStorage in project archi-modelrepository-plugin by archi-contribs.

the class ModelRepositoryPreferencePage method setValues.

private void setValues() {
    PersonIdent result = getUserDetails();
    fUserNameTextField.setText(result.getName());
    fUserEmailTextField.setText(result.getEmailAddress());
    fUserRepoFolderTextField.setText(getPreferenceStore().getString(PREFS_REPOSITORY_FOLDER));
    fStoreCredentialsButton.setSelection(getPreferenceStore().getBoolean(PREFS_STORE_REPO_CREDENTIALS));
    fUseProxyButton.setSelection(getPreferenceStore().getBoolean(PREFS_PROXY_USE));
    fProxyHostTextField.setText(getPreferenceStore().getString(PREFS_PROXY_HOST));
    fProxyPortTextField.setText(getPreferenceStore().getString(PREFS_PROXY_PORT));
    fRequiresProxyAuthenticationButton.setSelection(getPreferenceStore().getBoolean(PREFS_PROXY_REQUIRES_AUTHENTICATION));
    try {
        SimpleCredentialsStorage sc = new SimpleCredentialsStorage(new File(ModelRepositoryPlugin.INSTANCE.getUserModelRepositoryFolder(), IGraficoConstants.PROXY_CREDENTIALS_FILE));
        fProxyUserNameTextField.setText(StringUtils.safeString(sc.getUsername()));
        fProxyUserPasswordTextField.setText(StringUtils.safeString(sc.getPassword()));
    } catch (IOException ex) {
        ex.printStackTrace();
    }
    updateProxyControls();
}
Also used : SimpleCredentialsStorage(org.archicontribs.modelrepository.authentication.SimpleCredentialsStorage) PersonIdent(org.eclipse.jgit.lib.PersonIdent) IOException(java.io.IOException) File(java.io.File)

Aggregations

File (java.io.File)6 IOException (java.io.IOException)6 SimpleCredentialsStorage (org.archicontribs.modelrepository.authentication.SimpleCredentialsStorage)6 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)3 GitAPIException (org.eclipse.jgit.api.errors.GitAPIException)3 ArchiRepository (org.archicontribs.modelrepository.grafico.ArchiRepository)2 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)2 IArchimateModel (com.archimatetool.model.IArchimateModel)1 URISyntaxException (java.net.URISyntaxException)1 UsernamePassword (org.archicontribs.modelrepository.authentication.UsernamePassword)1 CloneInputDialog (org.archicontribs.modelrepository.dialogs.CloneInputDialog)1 NewModelRepoDialog (org.archicontribs.modelrepository.dialogs.NewModelRepoDialog)1 UserNamePasswordDialog (org.archicontribs.modelrepository.dialogs.UserNamePasswordDialog)1 GraficoModelLoader (org.archicontribs.modelrepository.grafico.GraficoModelLoader)1 IArchiRepository (org.archicontribs.modelrepository.grafico.IArchiRepository)1 Job (org.eclipse.core.runtime.jobs.Job)1 Git (org.eclipse.jgit.api.Git)1 ConfigInvalidException (org.eclipse.jgit.errors.ConfigInvalidException)1 PersonIdent (org.eclipse.jgit.lib.PersonIdent)1