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());
}
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();
}
Aggregations