Search in sources :

Example 11 with CvsRootConfiguration

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;
    }
}
Also used : LoginPerformer(com.intellij.cvsSupport2.cvsoperations.common.LoginPerformer) CvsRootException(com.intellij.cvsSupport2.connections.CvsRootException)

Example 12 with CvsRootConfiguration

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);
}
Also used : CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration)

Example 13 with CvsRootConfiguration

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());
    }
}
Also used : ThreeState(com.intellij.util.ThreeState) Ref(com.intellij.openapi.util.Ref) Task(com.intellij.openapi.progress.Task) CvsLoginWorker(com.intellij.cvsSupport2.connections.login.CvsLoginWorker) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) InputException(com.intellij.openapi.ui.InputException) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException)

Example 14 with CvsRootConfiguration

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);
}
Also used : CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration)

Example 15 with CvsRootConfiguration

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;
    }
}
Also used : CvsApplicationLevelConfiguration(com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration) ArrayList(java.util.ArrayList) CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

CvsRootConfiguration (com.intellij.cvsSupport2.config.CvsRootConfiguration)14 CvsApplicationLevelConfiguration (com.intellij.cvsSupport2.config.CvsApplicationLevelConfiguration)5 File (java.io.File)3 ArrayList (java.util.ArrayList)3 CvsConnectionSettings (com.intellij.cvsSupport2.connections.CvsConnectionSettings)2 IDEARootFormatter (com.intellij.cvsSupport2.connections.IDEARootFormatter)2 ProxySettings (com.intellij.cvsSupport2.config.ProxySettings)1 CvsConfigurationsListEditor (com.intellij.cvsSupport2.config.ui.CvsConfigurationsListEditor)1 CvsRootException (com.intellij.cvsSupport2.connections.CvsRootException)1 CvsLoginWorker (com.intellij.cvsSupport2.connections.login.CvsLoginWorker)1 CvsFile (com.intellij.cvsSupport2.cvsBrowser.CvsFile)1 LoginPerformer (com.intellij.cvsSupport2.cvsoperations.common.LoginPerformer)1 GetFileContentOperation (com.intellij.cvsSupport2.cvsoperations.cvsContent.GetFileContentOperation)1 SimpleRevision (com.intellij.cvsSupport2.cvsoperations.dateOrRevision.SimpleRevision)1 ComparableVcsRevisionOnOperation (com.intellij.cvsSupport2.history.ComparableVcsRevisionOnOperation)1 MigrateRootDialog (com.intellij.cvsSupport2.ui.MigrateRootDialog)1 AccessToken (com.intellij.openapi.application.AccessToken)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1