Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-01-31 19:17:09 +0000
committerjames2002-01-31 19:17:09 +0000
commit34fa0cff522f723777f0258b2d5901e2c838159d (patch)
treeea9b673fa59e3f651bdd1b7a528a4319dea63aab
parent7d8b168bc2681a07f54d9011f91f79b64f7e3b7a (diff)
downloadeclipse.platform.team-34fa0cff522f723777f0258b2d5901e2c838159d.tar.gz
eclipse.platform.team-34fa0cff522f723777f0258b2d5901e2c838159d.tar.xz
eclipse.platform.team-34fa0cff522f723777f0258b2d5901e2c838159d.zip
8713: Validation of new repo: cancel on password prompt shouldn't cancel wizard
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java34
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java20
4 files changed, 53 insertions, 10 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index b892858ba..b15119621 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -213,6 +213,10 @@ ModuleSelectionPage.specifyModule=Use specified module name:
NewLocationWizard.title=Add a new CVS Repository
NewLocationWizard.description=Add a new CVS Repository to the Repositories View
+NewLocationWizard.validationFailedText={0}. Keep location anyway?
+NewLocationWizard.validationFailedTitle=Unable to Validate
+NewLocationWizard.alreadyExistsTitle=Repository already exists
+NewLocationWizard.alreadyExists=The specified repository location already exists.
OpenLogEntryAction.open=Open
@@ -253,6 +257,9 @@ ResourcePropertiesPage.checkedIn=Checked In
#ResourcePropertiesPage.none=none
ResourcePropertiesPage.error=Error
+SharingWizard.validationFailedText={0}. Set project sharing anyway?
+SharingWizard.validationFailedTitle=Unable to Validate
+
ShowHistoryAction.showHistory=Show in Resource History
ShowHistoryAction.noHistory=No History Available
ShowHistoryAction.noHistoryLong=No resource history available for selected resources.
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
index c9daa4e12..f8751ae9b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java
@@ -166,7 +166,7 @@ public class ConfigurationWizardMainPage extends CVSWizardPage {
GridData data = new GridData();
data.horizontalSpan = 2;
validateButton.setLayoutData(data);
- validateButton.setText("Validate repository location on finish");
+ validateButton.setText(Policy.bind("ConfigurationWizardAutoconnectPage.validate"));
validateButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
validate = validateButton.getSelection();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java
index 8a72a8e40..aa53072a1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java
@@ -13,6 +13,8 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSProvider;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
@@ -51,19 +53,41 @@ public class NewLocationWizard extends Wizard {
public boolean performFinish() {
mainPage.finish(new NullProgressMonitor());
Properties properties = mainPage.getProperties();
+ ICVSRepositoryLocation root = null;
+ ICVSProvider provider = CVSProviderPlugin.getProvider();
try {
- ICVSRepositoryLocation root = CVSUIPlugin.getPlugin().getRepositoryManager().getRoot(properties);
+ // See if it already exists
+ root = provider.getRepository(properties);
+ if (root != null) {
+ MessageDialog.openInformation(getContainer().getShell(), Policy.bind("NewLocationWizard.alreadyExistsTitle"), Policy.bind("NewLocationWizard.alreadyExists"));
+ return false;
+ }
+ root = provider.createRepository(properties);
if (mainPage.getValidate()) {
root.validateConnection(new NullProgressMonitor());
}
} catch (TeamException e) {
IStatus error = e.getStatus();
- if (error.getSeverity() == IStatus.INFO) {
- MessageDialog.openInformation(getContainer().getShell(), Policy.bind("information"), error.getMessage());
- } else {
+ if (root == null) {
+ // Exception creating the root, we cannot continue
ErrorDialog.openError(getContainer().getShell(), Policy.bind("exception"), null, error);
+ return false;
+ } else {
+ // Exception validating. We can continue if the user wishes.
+ boolean keep = MessageDialog.openQuestion(getContainer().getShell(),
+ Policy.bind("NewLocationWizard.validationFailedTitle"),
+ Policy.bind("NewLocationWizard.validationFailedText", new Object[] {e.getStatus().getMessage()}));
+ if (!keep) {
+ // Remove the root
+ try {
+ provider.disposeRepository(root);
+ } catch (TeamException e1) {
+ ErrorDialog.openError(getContainer().getShell(), Policy.bind("exception"), null, e1.getStatus());
+ return false;
+ }
+ }
+ return keep;
}
- return false;
}
return true;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
index 37031739b..7f7d873a2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizard.java
@@ -148,13 +148,25 @@ public class SharingWizard extends Wizard implements IConfigurationWizard {
// Validate the connection if the user wants to
boolean validate = autoconnectPage.getValidate();
if (validate) {
- // Do the validation right now
+ // Do the validation
try {
location.validateConnection(new SubProgressMonitor(monitor, 50));
} catch (TeamException e) {
- if (created)
- CVSProviderPlugin.getProvider().disposeRepository(location);
- throw e;
+ // Exception validating. We can continue if the user wishes.
+ boolean keep = MessageDialog.openQuestion(getContainer().getShell(),
+ Policy.bind("SharingWizard.validationFailedTitle"),
+ Policy.bind("SharingWizard.validationFailedText", new Object[] {e.getStatus().getMessage()}));
+ if (!keep) {
+ // Remove the root
+ try {
+ CVSProviderPlugin.getProvider().disposeRepository(location);
+ } catch (TeamException e1) {
+ ErrorDialog.openError(getContainer().getShell(), Policy.bind("exception"), null, e1.getStatus());
+ }
+ result[0] = false;
+ return;
+ }
+ // They want to keep the connection anyway. Fall through.
}
}

Back to the top