use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class SelectCvsElementStep method isLogged.
private boolean isLogged(final CvsRootConfiguration selectedConfiguration) {
myErrors.set(null);
final LoginPerformer performer = new LoginPerformer(myProject, Collections.<CvsEnvironment>singletonList(selectedConfiguration), e -> myErrors.set(Boolean.TRUE));
try {
final boolean logged = performer.loginAll(false);
return logged && myErrors.isNull();
} catch (CvsRootException e) {
Messages.showErrorDialog(e.getMessage(), CvsBundle.message("error.title.invalid.cvs.root"));
return false;
}
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class Cvs2SettingsEditPanel method testConfiguration.
private void testConfiguration() {
final CvsRootConfiguration newConfiguration = createConfigurationWithCurrentSettings();
if (newConfiguration == null)
return;
try {
testConnection(newConfiguration, myPanel, myProject);
} catch (CvsRootException e) {
e.show();
return;
}
updateFrom(newConfiguration);
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class Cvs2SettingsEditPanel method testConnection.
private static void testConnection(final CvsRootConfiguration configuration, final Component component, Project project) {
final CvsLoginWorker loginWorker = configuration.getLoginWorker(project);
final Ref<Boolean> success = new Ref<>();
ProgressManager.getInstance().run(new Task.Modal(project, CvsBundle.message("message.connecting.to.cvs.server"), false) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setText2(CvsBundle.message("message.current.global.timeout.setting", CvsApplicationLevelConfiguration.getInstance().TIMEOUT));
try {
final ThreeState result = LoginPerformer.checkLoginWorker(loginWorker, true);
if (ThreeState.NO == result) {
showConnectionFailedMessage(component, CvsBundle.message("test.connection.login.failed.text"));
} else if (ThreeState.UNSURE == result) {
showConnectionFailedMessage(component, CvsBundle.message("error.message.authentication.canceled"));
} else {
success.set(Boolean.TRUE);
}
} catch (ProcessCanceledException ignore) {
} catch (final Exception e) {
showConnectionFailedMessage(component, e.getLocalizedMessage());
}
}
});
if (success.get() != Boolean.TRUE)
return;
try {
configuration.testConnection(project);
showSuccessfulConnectionMessage(component);
} catch (ProcessCanceledException ignore) {
} catch (final Exception e) {
showConnectionFailedMessage(component, e.getLocalizedMessage());
}
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class CvsConfigurationsListEditor method createNewConfiguration.
private void createNewConfiguration() {
if (!saveSelectedConfiguration())
return;
myList.setSelectedValue(null, false);
final CvsRootConfiguration newConfig = CvsApplicationLevelConfiguration.createNewConfiguration(CvsApplicationLevelConfiguration.getInstance());
myModel.addElement(newConfig);
myList.setSelectedValue(newConfig, true);
}
use of com.intellij.cvsSupport2.config.CvsRootConfiguration in project intellij-community by JetBrains.
the class CvsConfigurationsListEditor method reconfigureCvsRoot.
@Nullable
public static CvsRootConfiguration reconfigureCvsRoot(String root, Project project) {
final CvsApplicationLevelConfiguration configuration = CvsApplicationLevelConfiguration.getInstance();
final CvsRootConfiguration selectedConfig = configuration.getConfigurationForCvsRoot(root);
final ArrayList<CvsRootConfiguration> modifiableList = new ArrayList<>(configuration.CONFIGURATIONS);
final CvsConfigurationsListEditor editor = new CvsConfigurationsListEditor(modifiableList, project, true);
editor.select(selectedConfig);
if (editor.showAndGet()) {
configuration.CONFIGURATIONS = modifiableList;
return configuration.getConfigurationForCvsRoot(root);
} else {
return null;
}
}
Aggregations