use of org.jetbrains.idea.svn.dialogs.SimpleCredentialsDialog in project intellij-community by JetBrains.
the class AuthenticationService method requestSshCredentials.
@Nullable
public String requestSshCredentials(@NotNull final String realm, @NotNull final SimpleCredentialsDialog.Mode mode, @NotNull final String key) {
return requestCredentials(realm, StringUtil.toLowerCase(mode.toString()), () -> {
final Ref<String> answer = new Ref<>();
Runnable command = () -> {
SimpleCredentialsDialog dialog = new SimpleCredentialsDialog(myVcs.getProject());
dialog.setup(mode, realm, key, true);
dialog.setTitle(SvnBundle.message("dialog.title.authentication.required"));
dialog.setSaveEnabled(false);
if (dialog.showAndGet()) {
answer.set(dialog.getPassword());
}
};
// Use ModalityState.any() as currently ssh credentials in terminal mode are requested in the thread that reads output and not in
// the thread that started progress
WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(command, ModalityState.any());
return answer.get();
});
}
Aggregations