org.eclipse.rse.ui.validators
Class ValidatorLongInput
java.lang.Object
org.eclipse.rse.ui.validators.ValidatorLongInput
-
All Implemented Interfaces:
-
IInputValidator,
ICellEditorValidator,
ISystemValidator
-
Direct Known Subclasses:
-
ValidatorLongRangeInput
-
public class ValidatorLongInput
- extends
Object
- implements
ISystemValidator
For editable large numeric properties.
Ensures only digits are entered.
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
allowBlank
protected boolean allowBlank
number
protected long number
emptyMsg
protected
SystemMessage emptyMsg
invalidMsg
protected
SystemMessage invalidMsg
currentMessage
protected
SystemMessage currentMessage
ValidatorLongInput
public ValidatorLongInput()
- Constructor to use when the default error messages are ok
-
See Also:
-
setBlankAllowed(boolean)
ValidatorLongInput
public ValidatorLongInput(
SystemMessage emptyMsg)
- Constructor to use when wanting to specify the "value required" error message,
but use the default for the "Value not valid" error message
-
See Also:
-
setBlankAllowed(boolean)
ValidatorLongInput
public ValidatorLongInput(
SystemMessage emptyMsg,
SystemMessage invalidMsg)
- Constructor to use when wanting to specify both error messages
-
See Also:
-
setBlankAllowed(boolean)
setBlankAllowed
public void setBlankAllowed(boolean allowBlank)
- Specify if an empty field is ok or not. The default is not, and will result in an error message.
-
-
setErrorMessages
public void setErrorMessages(
SystemMessage emptyMsg,
SystemMessage invalidMsg)
- Set the error messages, overriding the defaults
-
-
isValid
public
String isValid(
Object input)
-
-
Specified by:
-
isValid
in interface
ICellEditorValidator
-
-
See Also:
-
ICellEditorValidator.isValid(java.lang.Object)
isValid
public
String isValid(
String input)
-
-
Specified by:
-
isValid
in interface
IInputValidator
-
-
See Also:
-
IInputValidator.isValid(java.lang.String)
,
getSystemMessage()
getSystemMessage
public
SystemMessage getSystemMessage()
- When isValid returns non-null, call this to get the SystemMessage object for the error
versus the simple string message.
-
-
Specified by:
-
getSystemMessage
in interface
ISystemValidator
-
getMaximumNameLength
public int getMaximumNameLength()
- Return the max length for this name. For us, we return 20.
-
-
Specified by:
-
getMaximumNameLength
in interface
ISystemValidator
-
validate
public
SystemMessage validate(
String text)
- For convenience, this is a shortcut to calling:
if (isValid(text) != null)
msg = getSystemMessage();
-
-
Specified by:
-
validate
in interface
ISystemValidator
-
getNumber
public long getNumber()
- If validation is true, you can call this to get the input as a number
-
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.