예제 #1
0
 private void Update(Credentials credentials, LoginOptions options)
 {
     View.UsernameEnabled = options.user() && !credentials.isAnonymousLogin();
     View.PasswordEnabled = options.password() && !credentials.isAnonymousLogin();
     View.UsernameLabel   = options.getUsernamePlaceholder() + ":";
     View.PasswordLabel   = options.getPasswordPlaceholder() + ":";
     {
         View.SavePasswordEnabled = options.keychain() && !credentials.isAnonymousLogin();
         View.SavePasswordState   = credentials.isSaved();
     }
     View.AnonymousEnabled = options.anonymous();
     if (options.anonymous() && credentials.isAnonymousLogin())
     {
         View.AnonymousState = true;
     }
     else
     {
         View.AnonymousState = false;
     }
     View.PrivateKeyFieldEnabled = options.publickey();
     if (options.publickey() && credentials.isPublicKeyAuthentication())
     {
         View.SelectedPrivateKey = credentials.getIdentity().getAbsolute();
     }
 }