From cfabc043fe9ceb3becbcd0a6d1a8db87e029a68d Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Fri, 16 Mar 2007 16:47:24 +0000 Subject: [PATCH] [177731][refactor]Connection names and filter pool names were restricted to being folder names by their validators. Filter names were restricted to being file names by the filter name validator. These have been refactored so that they now only require unique strings within their container. --- .../ui/validators/ValidatorConnectionName.java | 11 ++++++----- .../rse/ui/validators/ValidatorFilterName.java | 15 ++++++++------- .../ui/validators/ValidatorFilterPoolName.java | 13 +++++++------ rse/plugins/org.eclipse.rse.ui/systemmessages.xml | 2 +- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java index fc916cdb4ba..237b94badb1 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorConnectionName.java @@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Shell; * The IInputValidator interface is used by jface's * InputDialog class and numerous other platform and system classes. */ -public class ValidatorConnectionName extends ValidatorFolderName implements ISystemValidator +public class ValidatorConnectionName extends ValidatorUniqueString implements ISystemValidator { public static final int MAX_CONNECTIONNAME_LENGTH = 100; // arbitrary restriction due to defects @@ -42,10 +42,11 @@ public class ValidatorConnectionName extends ValidatorFolderName implements ISys */ public ValidatorConnectionName(Vector existingNameList) { - super(existingNameList); - super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTVALID)); + super(existingNameList, CASE_SENSITIVE); + setErrorMessages( + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_EMPTY), + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE) + ); } /** diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java index a4949b72b55..7515cf874fe 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterName.java @@ -23,13 +23,13 @@ import org.eclipse.rse.ui.RSEUIPlugin; /** * This class is used in dialogs that prompt for filter name. Filter names - * have to be unique, and to enable saving per file, must be a valid file name. + * have to be unique. *

* The IInputValidator interface is implemented by our parent and it * is used by jface's InputDialog class and property sheet window. */ public class ValidatorFilterName - extends ValidatorFileName implements ISystemValidator + extends ValidatorUniqueString implements ISystemValidator { public static final int MAX_FILTERNAME_LENGTH = 100; @@ -43,7 +43,7 @@ public class ValidatorFilterName */ public ValidatorFilterName(Vector existingList) { - super(existingList); + super(existingList, CASE_SENSITIVE); init(); } /** @@ -52,15 +52,16 @@ public class ValidatorFilterName */ public ValidatorFilterName(String[] existingList) { - super(existingList); + super(existingList, CASE_SENSITIVE); init(); } private void init() { - super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTUNIQUE), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTVALID)); + super.setErrorMessages( + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_EMPTY), + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTUNIQUE) + ); } public String toString() diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java index 8114077cb15..02b90099e63 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/validators/ValidatorFilterPoolName.java @@ -29,7 +29,7 @@ import org.eclipse.rse.ui.RSEUIPlugin; * is used by jface's InputDialog class and property sheet window. */ public class ValidatorFilterPoolName - extends ValidatorFolderName implements ISystemValidator + extends ValidatorUniqueString implements ISystemValidator { public static final int MAX_FILTERPOOLNAME_LENGTH = 50; @@ -40,7 +40,7 @@ public class ValidatorFilterPoolName */ public ValidatorFilterPoolName(Vector existingList) { - super(existingList); + super(existingList, CASE_SENSITIVE); init(); } /** @@ -49,15 +49,16 @@ public class ValidatorFilterPoolName */ public ValidatorFilterPoolName(String[] existingList) { - super(existingList); + super(existingList, CASE_SENSITIVE); init(); } private void init() { - super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTVALID)); + super.setErrorMessages( + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_EMPTY), + RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE) + ); } diff --git a/rse/plugins/org.eclipse.rse.ui/systemmessages.xml b/rse/plugins/org.eclipse.rse.ui/systemmessages.xml index a20033921d8..3950dc3e026 100644 --- a/rse/plugins/org.eclipse.rse.ui/systemmessages.xml +++ b/rse/plugins/org.eclipse.rse.ui/systemmessages.xml @@ -105,7 +105,7 @@ Contributors: Connection names must be unique to the profile that contains the connection. Specify a name not already in use. - Invalid connection name. Must be a valid folder name in the underlaying file system. + Invalid connection name. Must be a valid folder name in the underlying file system. The connection name is not syntactically valid. The name must be a valid folder name within the workbench and the underlying file system.