@Override public void loadRepositories() { clearErrors(); // Make sure we have a server url final String serverName = getServerName(); if (StringUtils.isEmpty(serverName)) { addError( ModelValidationInfo.createWithResource( PROP_SERVER_NAME, TfPluginBundle.KEY_LOGIN_FORM_TFS_ERRORS_NO_SERVER_NAME)); setConnectionStatus(false); return; } // verify server url is a valid url if (!UrlHelper.isValidServerUrl(serverName)) { addError( ModelValidationInfo.createWithResource( PROP_SERVER_NAME, TfPluginBundle.KEY_LOGIN_FORM_TFS_ERRORS_INVALID_SERVER_URL, serverName)); setConnectionStatus(false); return; } if (authenticationProvider.isAuthenticated()) { loadRepositoriesInternal(); } else { authenticationProvider.authenticateAsync( getServerName(), new AuthenticationListener() { @Override public void authenticating() { // We are starting to authenticate, so set the boolean setAuthenticating(true); } @Override public void authenticated( final AuthenticationInfo authenticationInfo, final Throwable throwable) { // Push this event back onto the UI thread IdeaHelper.runOnUIThread( new Runnable() { @Override public void run() { // Authentication is over, so set the boolean setAuthenticating(false); // Log exception if it failed if (throwable != null) { logger.warn("Connecting to TFS server failed", throwable); } // try to load the repos loadRepositoriesInternal(); } }); } }); } }