Package com.iizigo.validator
Class ControlValidator
java.lang.Object
com.iizigo.validator.ValidationAdapter
com.iizigo.validator.ControlValidator
- All Implemented Interfaces:
- IValidator,- EventListener,- FocusListener,- ModifyListener,- SelectionListener,- VerifyListener,- SWTEventListener
public class ControlValidator extends ValidationAdapter implements ModifyListener, VerifyListener, SelectionListener, FocusListener
Control validator class for dialog boxes.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final int- static final int- static final intFlags.- static final int- static final int- static final int- Fields inherited from class com.iizigo.validator.ValidationAdapter- hasBeenModified
- Method SummaryModifier and TypeMethodDescription- voidSent when a control gets focus.- voidSent when a control loses focus.- static Image- getImage- (int type) Gets the required image.Gets the message.- intGets the type of message (ERROR, WARNING, INFORMATION or NONE).- voidHandles modifications.- void- reset()Resets the validator before performing all validations in the manager.- void- setAtomNameValidator- (PropCnr container, GProp<?> property, boolean allowLeadingDollar) Assigns the callback to be an Atom Name Validator.- void- setDecoratedControl- (Control control) Place the control decorator on this component instead of the control.- setErrorMessage- (String message) Sets an error message.- setInformationMessage- (String message) Sets a warning message.- setRequiredMessage- (String message) Sets a required message.- void- setType- (int flags) Sets the type.- voidSets the description and flags.- void- setValidatorCallback- (ValidatorCallback callback) Sets the callback validator.- setWarningMessage- (String message) Sets a warning message.- boolean- validate()Performs validation.- voidVerifies input for for upper case and numeric only.- voidNot processed.- voidSelection changes (spinner).- Methods inherited from class com.iizigo.validator.ValidationAdapter- hasBeenModified, setModified
- Field Details- MUST_BE_SPECIFIEDpublic static final int MUST_BE_SPECIFIEDFlags.- See Also:
 
- UPPER_CASEpublic static final int UPPER_CASE- See Also:
 
- LOWER_CASEpublic static final int LOWER_CASE- See Also:
 
- NUMERIC_ONLYpublic static final int NUMERIC_ONLY- See Also:
 
- NUMERIC_INT_RANGEpublic static final int NUMERIC_INT_RANGE- See Also:
 
- CHECK_FOCUS_LOSTpublic static final int CHECK_FOCUS_LOST- See Also:
 
 
- Method Details- getImageGets the required image.- Parameters:
- type- Image type: NONE, INFORMATION, WARNING or ERROR.
 
- setDecoratedControlPlace the control decorator on this component instead of the control.- Parameters:
- control- The control, if e.g. a composite is wrapping an entry field.
 
- setValidatorCallbackSets the callback validator.
- setTypeSets the description and flags.
- setTypepublic void setType- (int flags) Sets the type.
- getMessageGets the message.- Specified by:
- getMessagein interface- IValidator
 
- setRequiredMessageSets a required message.
- setInformationMessageSets a warning message.
- setWarningMessageSets a warning message.
- setErrorMessageSets an error message.
- getMessageTypepublic int getMessageType()Gets the type of message (ERROR, WARNING, INFORMATION or NONE).- Specified by:
- getMessageTypein interface- IValidator
 
- modifyTextHandles modifications.- Specified by:
- modifyTextin interface- ModifyListener
 
- verifyTextVerifies input for for upper case and numeric only.- Specified by:
- verifyTextin interface- VerifyListener
 
- widgetSelectedSelection changes (spinner).- Specified by:
- widgetSelectedin interface- SelectionListener
 
- widgetDefaultSelectedNot processed.- Specified by:
- widgetDefaultSelectedin interface- SelectionListener
 
- resetpublic void reset()Resets the validator before performing all validations in the manager.- Specified by:
- resetin interface- IValidator
 
- validatepublic boolean validate()Performs validation.- Specified by:
- validatein interface- IValidator
- Returns:
- true for success, false for failure.
 
- setAtomNameValidatorAssigns the callback to be an Atom Name Validator.- Parameters:
- container- Property container where the name must not exist, null for no check.
- property- The property (name) being edited, null for none.
- allowLeadingDollar- Flag indicating leading dollar is allowed or not.
 
- focusGainedSent when a control gets focus.- Specified by:
- focusGainedin interface- FocusListener
- Parameters:
- e- An event containing information about the focus change.
 
- focusLostSent when a control loses focus.- Specified by:
- focusLostin interface- FocusListener
- Parameters:
- e- An event containing information about the focus change.