|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.ui.validators.ValidatorUniqueString
org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName
public class ValidatorFileUniqueName
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.
Field Summary | |
---|---|
protected boolean |
isFolder
|
protected SystemMessage |
msg_Invalid
|
protected Vector |
names
|
protected IRemoteFile |
parentFolder
|
Fields inherited from class org.eclipse.rse.ui.validators.ValidatorUniqueString |
---|
CASE_INSENSITIVE, CASE_SENSITIVE, caseSensitive, currentMessage, existingList, msg_Empty, msg_NonUnique, QUOTE, syntaxValidator, useUpperCase |
Constructor Summary | |
---|---|
ValidatorFileUniqueName(Shell shell,
IRemoteFile parentFolder,
boolean isFolder)
Constructor |
Method Summary | |
---|---|
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 |
protected ValidatorFolderName |
getFolderNameValidator()
Overridable extension point to get basic folder name validator. |
int |
getMaximumNameLength()
Return the max length for this file or folder name |
SystemMessage |
isSyntaxOk(String newText)
Validate each character. |
void |
setErrorMessages(SystemMessage msg_Empty,
SystemMessage msg_NonUnique,
SystemMessage msg_Invalid)
Supply your own error message text. |
String |
toString()
|
Methods inherited from class org.eclipse.rse.ui.validators.ValidatorUniqueString |
---|
doMessageSubstitution, getExistingNamesList, getSystemMessage, getSystemMessageText, isValid, isValid, quotedToLowerCase, setCaseSensitive, setErrorMessages, setExistingNamesList, setExistingNamesList, setUseUpperCase, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SystemMessage msg_Invalid
protected IRemoteFile parentFolder
protected Vector names
protected boolean isFolder
Constructor Detail |
---|
public ValidatorFileUniqueName(Shell shell, IRemoteFile parentFolder, boolean isFolder)
parentFolder
- the folder within which the name must be unique.isFolder
- true if validating a folder name versus a file nameMethod Detail |
---|
public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
msg_Empty
- error message when entry field is emptymsg_NonUnique
- error message when value entered is not uniquemsg_Invalid
- error message when syntax is not validpublic SystemMessage isSyntaxOk(String newText)
isSyntaxOk
in class ValidatorUniqueString
protected ValidatorFileName getFileNameValidator()
protected ValidatorFolderName getFolderNameValidator()
public int getMaximumNameLength()
getMaximumNameLength
in interface ISystemValidator
getMaximumNameLength
in class ValidatorUniqueString
public String toString()
toString
in class ValidatorUniqueString
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |