Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-03-14 13:35:33 +0000
committerMichael Valenta2002-03-14 13:35:33 +0000
commit92f89a2cbea0a246e2deae74dfdff68e39055dea (patch)
tree607f896f75356ef54c759d878746c9ffc171a274
parentd3637850673a39c44025e0ce4b293669f0f4cc9b (diff)
downloadeclipse.platform.team-92f89a2cbea0a246e2deae74dfdff68e39055dea.tar.gz
eclipse.platform.team-92f89a2cbea0a246e2deae74dfdff68e39055dea.tar.xz
eclipse.platform.team-92f89a2cbea0a246e2deae74dfdff68e39055dea.zip
11188: Internal error in "Checkout As" if project name is invalid
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
index e620868ea..ddf36d545 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutAsAction.java
@@ -10,10 +10,13 @@ import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -78,7 +81,17 @@ public class CheckoutAsAction extends TeamAction {
String name = folders[0].getName();
// Prompt for name
final int[] result = new int[] { InputDialog.OK };
- final InputDialog dialog = new InputDialog(shell, Policy.bind("CheckoutAsAction.enterProjectTitle"), Policy.bind("CheckoutAsAction.enterProject"), name, null);
+ final InputDialog dialog = new InputDialog(shell, Policy.bind("CheckoutAsAction.enterProjectTitle"), Policy.bind("CheckoutAsAction.enterProject"), name,
+ new IInputValidator() {
+ public String isValid(String newText) {
+ IStatus status = ResourcesPlugin.getWorkspace().validateName(newText, IResource.PROJECT);
+ if (status.isOK()) {
+ return ""; //$NON-NLS-1$
+ }
+ return status.getMessage();
+ }
+
+ });
shell.getDisplay().syncExec(new Runnable() {
public void run() {
result[0] = dialog.open();

Back to the top