|
org.eclipse.rse.subsystems.files.core.util
Class ValidatorFileUniqueName
java.lang.Object
org.eclipse.rse.ui.validators.ValidatorUniqueString
org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName
-
All Implemented Interfaces:
-
IInputValidator,
ICellEditorValidator,
ISystemValidator,
ISystemValidatorUniqueString
-
public class ValidatorFileUniqueName
- extends
ValidatorUniqueString
This class is used in dialogs that prompt for file or folder names, and those names need to be unique
within a given folder. To make sure error checking while typing is fast, we go get the list of names
of the files and folders in the constructor and re-use it from then on.
The IInputValidator interface is implemented by our parent and it
is used by jface's InputDialog class and property sheet window.
If you subclass this, consider overriding the getFileNameValidator and
getFolderNameValidator methods.
Methods inherited from class org.eclipse.rse.ui.validators.
ValidatorUniqueString
|
doMessageSubstitution,
getExistingNamesList,
getSystemMessage,
getSystemMessageText,
isValid,
isValid,
quotedToLowerCase,
setCaseSensitive,
setErrorMessages,
setExistingNamesList,
setExistingNamesList,
setUseUpperCase,
validate
|
msg_Invalid
protected
SystemMessage msg_Invalid
parentFolder
protected
IRemoteFile parentFolder
names
protected
Vector names
isFolder
protected boolean isFolder
ValidatorFileUniqueName
public ValidatorFileUniqueName(
Shell shell,
IRemoteFile parentFolder,
boolean isFolder)
- Constructor
-
Parameters:
-
parentFolder - the folder within which the name must be unique. -
isFolder - true if validating a folder name versus a file name
setErrorMessages
public void setErrorMessages(
SystemMessage msg_Empty,
SystemMessage msg_NonUnique,
SystemMessage msg_Invalid)
- Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
-
-
Parameters:
-
msg_Empty - error message when entry field is empty -
msg_NonUnique - error message when value entered is not unique -
msg_Invalid - error message when syntax is not valid
isSyntaxOk
public
SystemMessage isSyntaxOk(
String newText)
- Validate each character.
Override of parent method.
Override yourself to refine the error checking.
-
-
Overrides:
-
isSyntaxOk
in class
ValidatorUniqueString
-
getFileNameValidator
protected
ValidatorFileName getFileNameValidator()
- Overridable extension point to get basic file name validator
By default, queries it from the file subsystem factory of the parent folder
-
getFolderNameValidator
protected
ValidatorFolderName getFolderNameValidator()
- Overridable extension point to get basic folder name validator.
By default, queries it from the file subsystem factory of the parent folder
-
getMaximumNameLength
public int getMaximumNameLength()
- Return the max length for this file or folder name
-
-
Specified by:
-
getMaximumNameLength
in interface
ISystemValidator
-
Overrides:
-
getMaximumNameLength
in class
ValidatorUniqueString
-
toString
public
String toString()
-
-
Overrides:
-
toString
in class
ValidatorUniqueString
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.
|
|