Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-05-19 15:02:12 -0400
committerjames2002-05-19 15:02:12 -0400
commit53532c07103caebd06e3741578cb09833a7bbb69 (patch)
tree8d65b77c9a72990c4ee29af5e8986b40c4e2c2ca
parentfd81aba734e2c998c54d50098d488f328c503678 (diff)
downloadeclipse.platform.team-53532c07103caebd06e3741578cb09833a7bbb69.tar.gz
eclipse.platform.team-53532c07103caebd06e3741578cb09833a7bbb69.tar.xz
eclipse.platform.team-53532c07103caebd06e3741578cb09833a7bbb69.zip
11954: cvs pref page: should not let me enter -1 as timeout
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
2 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index 7ccb0ed19..f2bbf27c2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -186,9 +186,16 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
public void modifyText(ModifyEvent e) {
// Parse the timeout value
try {
- Integer.parseInt(timeoutValue.getText());
- setValid(true);
+ int x = Integer.parseInt(timeoutValue.getText());
+ if (x >= 0) {
+ setErrorMessage(null);
+ setValid(true);
+ } else {
+ setErrorMessage(Policy.bind("CVSPreferencesPage.Timeout_must_not_be_negative_1")); //$NON-NLS-1$
+ setValid(false);
+ }
} catch (NumberFormatException ex) {
+ setErrorMessage(Policy.bind("CVSPreferencesPage.Timeout_must_be_a_number_2")); //$NON-NLS-1$
setValid(false);
}
}
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 7a38372d1..75a25af31 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
@@ -723,3 +723,5 @@ AlternateUserValidationDialog.Cancel_7=Cancel
AlternateUserValidationDialog.message=Enter the password for {0}:
WorkbenchUserAuthenticator.The_operation_was_canceled_by_the_user_1=The operation was canceled by the user
CVSCatchupReleaseViewer.No_workspace_file_1=No workspace file
+CVSPreferencesPage.Timeout_must_not_be_negative_1=Timeout must not be negative
+CVSPreferencesPage.Timeout_must_be_a_number_2=Timeout must be a number

Back to the top