Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.ui.validators
Class ValidatorIntegerInput

java.lang.Object
  extended by 
org.eclipse.rse.ui.validators.ValidatorIntegerInput
All Implemented Interfaces:
IInputValidator, ICellEditorValidator, 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
           
protected   SystemMessage currentMessage
           
protected   SystemMessage emptyMsg
           
protected   SystemMessage invalidMsg
           
protected  int number
           
 
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

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)
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, 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


RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire