1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +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
* 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)
);
}
/**

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
* have to be unique, and to enable saving per file, must be a valid file name.
* have to be unique.
* <p>
* 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()

View file

@ -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)
);
}

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>
</Message>
<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>
</Message>
<Message ID="1024" Indicator="E">