1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 10:05:24 +02:00

[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.

This commit is contained in:
David Dykstal 2007-03-16 16:47:24 +00:00
parent a9d61fdbac
commit cfabc043fe
4 changed files with 22 additions and 19 deletions

View file

@ -32,7 +32,7 @@ import org.eclipse.swt.widgets.Shell;
* The IInputValidator interface is used by jface's * The IInputValidator interface is used by jface's
* InputDialog class and numerous other platform and system classes. * 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 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) public ValidatorConnectionName(Vector existingNameList)
{ {
super(existingNameList); super(existingNameList, CASE_SENSITIVE);
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_EMPTY), setErrorMessages(
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_EMPTY),
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTVALID)); RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_CONNECTIONNAME_NOTUNIQUE)
);
} }
/** /**

View file

@ -23,13 +23,13 @@ import org.eclipse.rse.ui.RSEUIPlugin;
/** /**
* This class is used in dialogs that prompt for filter name. Filter names * 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.
* <p> * <p>
* The IInputValidator interface is implemented by our parent and it * The IInputValidator interface is implemented by our parent and it
* is used by jface's InputDialog class and property sheet window. * is used by jface's InputDialog class and property sheet window.
*/ */
public class ValidatorFilterName public class ValidatorFilterName
extends ValidatorFileName implements ISystemValidator extends ValidatorUniqueString implements ISystemValidator
{ {
public static final int MAX_FILTERNAME_LENGTH = 100; public static final int MAX_FILTERNAME_LENGTH = 100;
@ -43,7 +43,7 @@ public class ValidatorFilterName
*/ */
public ValidatorFilterName(Vector existingList) public ValidatorFilterName(Vector existingList)
{ {
super(existingList); super(existingList, CASE_SENSITIVE);
init(); init();
} }
/** /**
@ -52,15 +52,16 @@ public class ValidatorFilterName
*/ */
public ValidatorFilterName(String[] existingList) public ValidatorFilterName(String[] existingList)
{ {
super(existingList); super(existingList, CASE_SENSITIVE);
init(); init();
} }
private void init() private void init()
{ {
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_EMPTY), super.setErrorMessages(
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTUNIQUE), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_EMPTY),
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTVALID)); RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERNAME_NOTUNIQUE)
);
} }
public String toString() public String toString()

View file

@ -29,7 +29,7 @@ import org.eclipse.rse.ui.RSEUIPlugin;
* is used by jface's InputDialog class and property sheet window. * is used by jface's InputDialog class and property sheet window.
*/ */
public class ValidatorFilterPoolName public class ValidatorFilterPoolName
extends ValidatorFolderName implements ISystemValidator extends ValidatorUniqueString implements ISystemValidator
{ {
public static final int MAX_FILTERPOOLNAME_LENGTH = 50; public static final int MAX_FILTERPOOLNAME_LENGTH = 50;
@ -40,7 +40,7 @@ public class ValidatorFilterPoolName
*/ */
public ValidatorFilterPoolName(Vector existingList) public ValidatorFilterPoolName(Vector existingList)
{ {
super(existingList); super(existingList, CASE_SENSITIVE);
init(); init();
} }
/** /**
@ -49,15 +49,16 @@ public class ValidatorFilterPoolName
*/ */
public ValidatorFilterPoolName(String[] existingList) public ValidatorFilterPoolName(String[] existingList)
{ {
super(existingList); super(existingList, CASE_SENSITIVE);
init(); init();
} }
private void init() private void init()
{ {
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_EMPTY), super.setErrorMessages(
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE), RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_EMPTY),
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTVALID)); RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_FILTERPOOLNAME_NOTUNIQUE)
);
} }

View file

@ -105,7 +105,7 @@ Contributors:
<LevelTwo>Connection names must be unique to the profile that contains the connection. Specify a name not already in use.</LevelTwo> <LevelTwo>Connection names must be unique to the profile that contains the connection. Specify a name not already in use.</LevelTwo>
</Message> </Message>
<Message ID="1023" Indicator="E"> <Message ID="1023" Indicator="E">
<LevelOne>Invalid connection name. Must be a valid folder name in the underlaying file system.</LevelOne> <LevelOne>Invalid connection name. Must be a valid folder name in the underlying file system.</LevelOne>
<LevelTwo>The connection name is not syntactically valid. The name must be a valid folder name within the workbench and the underlying file system.</LevelTwo> <LevelTwo>The connection name is not syntactically valid. The name must be a valid folder name within the workbench and the underlying file system.</LevelTwo>
</Message> </Message>
<Message ID="1024" Indicator="E"> <Message ID="1024" Indicator="E">