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
Answertopia.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 ValidatorLongInput


java.lang.Object
  extended by 
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.


Field Summary
protected  boolean allowBlank
           
protected   SystemMessage currentMessage
           
protected   SystemMessage emptyMsg
           
protected   SystemMessage invalidMsg
           
protected  long number
           
 
Constructor Summary
ValidatorLongInput ()
          Constructor to use when the default error messages are ok
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
ValidatorLongInput ( 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.
 long 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 long number

emptyMsg

protected 
SystemMessage emptyMsg

invalidMsg

protected 
SystemMessage invalidMsg

currentMessage

protected 
SystemMessage currentMessage
Constructor Detail

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


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