|
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.ValidatorSpecialChar
public class ValidatorSpecialChar
This class is used in dialogs that prompt for string, where the string is not allowed to content special characters, as supplied to this class. The IInputValidator interface is used by jface's InputDialog class and numerous other platform and system classes.
| Field Summary | |
|---|---|
protected SystemMessage |
currentMessage
|
static boolean |
EMPTY_ALLOWED_NO
|
static boolean |
EMPTY_ALLOWED_YES
|
protected SystemMessage |
msg_Empty
|
protected SystemMessage |
msg_Invalid
|
protected StringBuffer |
specialChars
|
| Constructor Summary | |
|---|---|
ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed)
Constructor |
|
ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed,
SystemMessage msg_Invalid)
Constructor |
|
ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed,
SystemMessage msg_Invalid,
SystemMessage msg_Empty)
Constructor |
|
| Method Summary | |
|---|---|
protected boolean |
containsSpecialCharacters(String newText)
|
protected String |
doMessageSubstitution(SystemMessage msg,
String substitution)
Helper method to substitute data into a message |
int |
getMaximumNameLength()
Return the max length for this name, or -1 if no max |
SystemMessage |
getSystemMessage()
When isValid returns non-null, call this to get the SystemMessage object for the error versus the simple string message. |
protected String |
getSystemMessageText(SystemMessage msg)
Helper method to set the current system message and return its level one text |
SystemMessage |
isSyntaxOk(String newText)
Override in child to do your own syntax checking. |
String |
isValid(Object newValue)
As required by ICellEditor |
String |
isValid(String newText)
Validate each character. |
void |
setErrorMessages(SystemMessage msg_Empty,
SystemMessage msg_Invalid)
Supply your own error message text. |
SystemMessage |
validate(String text)
For convenience, this is a shortcut to calling:
if (isValid(text) ! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean EMPTY_ALLOWED_NO
public static final boolean EMPTY_ALLOWED_YES
protected StringBuffer specialChars
protected SystemMessage msg_Invalid
protected SystemMessage msg_Empty
protected SystemMessage currentMessage
| Constructor Detail |
|---|
public ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed)
specialChars - String containing special characters to test for.isEmptyAllowed - true if an empty string is valid
public ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed,
SystemMessage msg_Invalid)
specialChars - String containing special characters to test for.isEmptyAllowed - true if an empty string is validmsg_Invalid - error message when invalid characters entered
public ValidatorSpecialChar(String specialChars,
boolean isEmptyAllowed,
SystemMessage msg_Invalid,
SystemMessage msg_Empty)
specialChars - String containing special characters to test for.isEmptyAllowed - true if an empty string is validmsg_Invalid - error message when invalid characters enteredmsg_Empty - error message when empty string| Method Detail |
|---|
public void setErrorMessages(SystemMessage msg_Empty,
SystemMessage msg_Invalid)
msg_Empty - error message when entry field is empty or null if to keep the defaultmsg_Invalid - error message when value entered is not valid, or null if to keep the default
protected String doMessageSubstitution(SystemMessage msg,
String substitution)
protected String getSystemMessageText(SystemMessage msg)
public String isValid(String newText)
isValid in interface IInputValidatorpublic String isValid(Object newValue)
isValid in interface ICellEditorValidatorprotected boolean containsSpecialCharacters(String newText)
public SystemMessage isSyntaxOk(String newText)
public int getMaximumNameLength()
getMaximumNameLength in interface ISystemValidatorpublic SystemMessage getSystemMessage()
getSystemMessage in interface ISystemValidatorpublic SystemMessage validate(String text)
if (isValid(text) != null)
msg = getSystemMessage();
validate in interface ISystemValidator
|
RSE Release 3.4 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||