Remote Systems
v6.4.1

com.ibm.etools.systems.core.ui.validators
Class ValidatorIntegerInput

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.validators.ValidatorIntegerInput
All Implemented Interfaces:
ISystemValidator
Direct Known Subclasses:
ValidatorIntegerRangeInput, ValidatorPortInput

public class ValidatorIntegerInput
extends Object
implements ISystemValidator

For editable numeric properties. Ensures only digits are entered.


Field Summary
protected  boolean allowBlank
           
static String copyright
           
protected  SystemMessage currentMessage
           
protected  SystemMessage emptyMsg
           
protected  SystemMessage invalidMsg
           
protected  int number
           
 
Fields inherited from interface com.ibm.etools.systems.core.ui.validators.ISystemValidator
Copyright
 
Constructor Summary
ValidatorIntegerInput()
          Constructor to use when the default error messages are ok
ValidatorIntegerInput(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
ValidatorIntegerInput(SystemMessage emptyMsg, SystemMessage invalidMsg)
          Constructor to use when wanting to specify both error messages
 
Method Summary
 int getMaximumNameLength()
          Return the max length for this name, or -1 if no max.
 int getNumber()
          If validation is true, you can call this to get the input as a number
 SystemMessage getSystemMessage()
          When isValid returns non-null, call this to get the SystemMessage object for the error versus the simple string message.
 String isValid(Object input)
           
 String isValid(String input)
           
 void setBlankAllowed(boolean allowBlank)
          Specify if an empty field is ok or not.
 void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
          Set the error messages, overriding the defaults
 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

copyright

public static final String copyright
See Also:
Constant Field Values

allowBlank

protected boolean allowBlank

number

protected int number

emptyMsg

protected SystemMessage emptyMsg

invalidMsg

protected SystemMessage invalidMsg

currentMessage

protected SystemMessage currentMessage
Constructor Detail

ValidatorIntegerInput

public ValidatorIntegerInput()
Constructor to use when the default error messages are ok

See Also:
setBlankAllowed(boolean)

ValidatorIntegerInput

public ValidatorIntegerInput(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)

ValidatorIntegerInput

public ValidatorIntegerInput(SystemMessage emptyMsg,
                             SystemMessage invalidMsg)
Constructor to use when wanting to specify both error messages

See Also:
setBlankAllowed(boolean)
Method Detail

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)
See Also:
ICellEditorValidator

isValid

public String isValid(String input)
See Also:
IInputValidator, 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, or -1 if no max. For integers, the maximum is +- 2 to the 16th, so we set the max at 11 (to include the sign).

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 int getNumber()
If validation is true, you can call this to get the input as a number


Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.