Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-03-05 13:49:36 -0500
committerjames2002-03-05 13:49:36 -0500
commit8762b83a46fbde6eca4d868a544b0f3921b5c502 (patch)
tree6ba0e889e62dd34518dba4bc73744cef64480b3e
parentaefc144e887deb076015793dc9e981e83c8bb1e1 (diff)
downloadeclipse.platform.team-8762b83a46fbde6eca4d868a544b0f3921b5c502.tar.gz
eclipse.platform.team-8762b83a46fbde6eca4d868a544b0f3921b5c502.tar.xz
eclipse.platform.team-8762b83a46fbde6eca4d868a544b0f3921b5c502.zip
9317: Server Exception defining branch tag
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineBranchAction.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineVersionAction.java12
2 files changed, 22 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineBranchAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineBranchAction.java
index 594a8c2d0..529f6d163 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineBranchAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineBranchAction.java
@@ -11,7 +11,9 @@ import java.util.Iterator;
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.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -29,6 +31,14 @@ import org.eclipse.team.ui.actions.TeamAction;
* DefineTagAction remembers a tag by name
*/
public class DefineBranchAction extends TeamAction {
+ IInputValidator validator = new IInputValidator() {
+ public String isValid(String newText) {
+ IStatus status = CVSTag.validateTagName(newText);
+ if (status.isOK()) return null;
+ return status.getMessage();
+ }
+ };
+
/**
* Returns the selected remote roots
*/
@@ -75,7 +85,7 @@ public class DefineBranchAction extends TeamAction {
Shell shell = getShell();
shell.getDisplay().syncExec(new Runnable() {
public void run() {
- InputDialog dialog = new InputDialog(getShell(), Policy.bind("DefineBranchAction.enterTag"), Policy.bind("DefineBranchAction.enterTagLong"), null, null);
+ InputDialog dialog = new InputDialog(getShell(), Policy.bind("DefineBranchAction.enterTag"), Policy.bind("DefineBranchAction.enterTagLong"), null, validator);
if (dialog.open() == InputDialog.OK) {
CVSTag tag = new CVSTag(dialog.getValue(), CVSTag.BRANCH);
CVSUIPlugin.getPlugin().getRepositoryManager().addBranchTags(roots[0], new BranchTag[] {new BranchTag(tag, roots[0])});
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineVersionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineVersionAction.java
index 834153f54..762acc6a2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineVersionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/DefineVersionAction.java
@@ -11,7 +11,9 @@ import java.util.Iterator;
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.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -33,6 +35,14 @@ import org.eclipse.team.ui.actions.TeamAction;
* The selection object for this action is a RemoteModule.
*/
public class DefineVersionAction extends TeamAction {
+ IInputValidator validator = new IInputValidator() {
+ public String isValid(String newText) {
+ IStatus status = CVSTag.validateTagName(newText);
+ if (status.isOK()) return null;
+ return status.getMessage();
+ }
+ };
+
/**
* Returns the selected remote projects
*/
@@ -75,7 +85,7 @@ public class DefineVersionAction extends TeamAction {
Shell shell = getShell();
shell.getDisplay().syncExec(new Runnable() {
public void run() {
- InputDialog dialog = new InputDialog(getShell(), Policy.bind("DefineVersionAction.enterTag"), Policy.bind("DefineVersionAction.enterTagLong"), null, null);
+ InputDialog dialog = new InputDialog(getShell(), Policy.bind("DefineVersionAction.enterTag"), Policy.bind("DefineVersionAction.enterTagLong"), null, validator);
if (dialog.open() == InputDialog.OK) {
ICVSRemoteResource resource = projects[0].getCVSResource();
CVSTag tag = new CVSTag(dialog.getValue(), CVSTag.VERSION);

Back to the top