Search in sources :

Example 6 with CredentialsMapping

use of com.mucommander.auth.CredentialsMapping in project mucommander by mucommander.

the class AuthDialog method comboBoxSelectionChanged.

// ///////////////////////////////////////////
// EditableComboBoxListener implementation //
// ///////////////////////////////////////////
public void comboBoxSelectionChanged(SaneComboBox source) {
    CredentialsMapping selectedCredentialsMapping = credentialsMappings[loginComboBox.getSelectedIndex()];
    Credentials selectedCredentials = selectedCredentialsMapping.getCredentials();
    loginField.setText(selectedCredentials.getLogin());
    passwordField.setText(selectedCredentials.getPassword());
    // Enable/disable 'save credentials' checkbox depending on whether the selected credentials are persistent or not
    if (saveCredentialsCheckBox != null)
        saveCredentialsCheckBox.setSelected(selectedCredentialsMapping.isPersistent());
}
Also used : Credentials(com.mucommander.commons.file.Credentials) CredentialsMapping(com.mucommander.auth.CredentialsMapping)

Example 7 with CredentialsMapping

use of com.mucommander.auth.CredentialsMapping in project mucommander by mucommander.

the class EditCredentialsDialog method modifyCredentials.

/**
 * Updates the value of the item that was being editing. Should be called whenever the list selection has changed.
 */
private void modifyCredentials() {
    // Make sure that the item still exists (could have been removed) before trying to modify its value
    int itemIndex = credentials.indexOf(lastSelectedItem);
    if (lastSelectedItem != null && itemIndex != -1) {
        credentials.setElementAt(new CredentialsMapping(new Credentials(loginField.getText(), new String(passwordField.getPassword())), lastSelectedItem.getRealm(), true), itemIndex);
    }
    this.lastSelectedItem = (CredentialsMapping) credentialsList.getSelectedValue();
}
Also used : Credentials(com.mucommander.commons.file.Credentials) CredentialsMapping(com.mucommander.auth.CredentialsMapping)

Aggregations

CredentialsMapping (com.mucommander.auth.CredentialsMapping)7 Credentials (com.mucommander.commons.file.Credentials)5 FileURL (com.mucommander.commons.file.FileURL)3 AbstractFile (com.mucommander.commons.file.AbstractFile)2 AuthException (com.mucommander.commons.file.AuthException)2 AuthDialog (com.mucommander.ui.dialog.auth.AuthDialog)2 AuthenticationType (com.mucommander.commons.file.AuthenticationType)1 DialogAction (com.mucommander.ui.dialog.DialogAction)1 QuestionDialog (com.mucommander.ui.dialog.QuestionDialog)1 Cursor (java.awt.Cursor)1 File (java.io.File)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1