com.ibm.ulc.ui.dataTypes
Class UIRegularExpressionValidator

java.lang.Object
  |
  +--com.ibm.ulc.util.UlcObject
        |
        +--com.ibm.ulc.ui.UIProxy
              |
              +--com.ibm.ulc.ui.dataTypes.UIDataType
                    |
                    +--com.ibm.ulc.ui.dataTypes.UIRegularExpressionValidator

public class UIRegularExpressionValidator
extends UIDataType

See Also:
Serialized Form

Field Summary
 IRegularExpression fInputFilterExpression
          The expression that is checked as each character is typed.
 IRegularExpression fValidateExpression
          The expression that is checked when the field looses its focus.
 
Fields inherited from class com.ibm.ulc.ui.UIProxy
fConnection, fId
 
Constructor Summary
UIRegularExpressionValidator()
          UIRegularExpressionValidator constructor comment.
 
Method Summary
 java.lang.Object convertToObject(int phase, java.lang.String newString, java.lang.Object previousValue)
          Check if the input string conforms to the regular expression.
protected  IRegularExpression createRegularExpression(java.lang.String expression)
           
 java.lang.String filterInput(java.lang.String newString)
          The default implementation returns original string without modification.
 boolean matchPattern(IRegularExpression regExpPattern, java.lang.String matchString)
          Return true if the string matches the regExpPattern otherwise false.
 void restoreState(ORBConnection conn, Anything args)
          This method is the first method called after this widget is instantiated.
 
Methods inherited from class com.ibm.ulc.ui.dataTypes.UIDataType
convertToString, filterInput, getCols, getDefaultValue
 
Methods inherited from class com.ibm.ulc.ui.UIProxy
add, add, addInstance, addMany, convert, convert, finalize, find, free, getManaged, handleRequest, isOptionalEventEnabled, printInstances, remove, remove, removeInstance, removeMany, sendEventULC, sendEventULC, sendEventULC, sendOptionalEventULC, sendOptionalEventULC, sendOptionalEventULC, sendULC, sendULC, setOptionalEventsEnabled, trouble
 
Methods inherited from class com.ibm.ulc.util.UlcObject
trouble2, trouble2Err, troubleErr
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fValidateExpression

public IRegularExpression fValidateExpression
The expression that is checked when the field looses its focus.

fInputFilterExpression

public IRegularExpression fInputFilterExpression
The expression that is checked as each character is typed. Usually the input expression is more lenient than the validate expression to reduce the amount of checks that take place during each keystroke.
Constructor Detail

UIRegularExpressionValidator

public UIRegularExpressionValidator()
UIRegularExpressionValidator constructor comment.
Method Detail

convertToObject

public java.lang.Object convertToObject(int phase,
                                        java.lang.String newString,
                                        java.lang.Object previousValue)
                                 throws DataTypeConversionException
Check if the input string conforms to the regular expression. Throw an exception on error.
Parameters:
phase - int The current validation phase. The phase can be one of the following:
	FORM_NOTIFICATION_IMMEADIATE : Typically no validation is performed in this case the input string is returned as is.
	FORM_NOTIFICATION_ON_FOCUS_CHANGE 	 
 	FORM_NOTIFICATION_ON_REQUEST
	
newString - The String to convert.
Returns:
An object representing the converted String or null.
Overrides:
convertToObject in class UIDataType
See Also:
IDataType.convertToObject(int, String, Object)

createRegularExpression

protected IRegularExpression createRegularExpression(java.lang.String expression)
Parameters:
expression - java.lang.String
Returns:
com.ibm.ulc.ui.regexp.IRegularExpression

filterInput

public java.lang.String filterInput(java.lang.String newString)
The default implementation returns original string without modification.
Overrides:
filterInput in class UIDataType
See Also:
IDataType.filterInput(String)

matchPattern

public boolean matchPattern(IRegularExpression regExpPattern,
                            java.lang.String matchString)
Return true if the string matches the regExpPattern otherwise false.

restoreState

public void restoreState(ORBConnection conn,
                         Anything args)
This method is the first method called after this widget is instantiated. All widget specific initialization must take place in this method. All the parameters necessary to initialize this widget are specified in the arguments. Subclasses implementing this method must call the superclass implementation as well.
Parameters:
conn - the UlcConnection in which this operation is performed
args - the Anything containing the optional initialization parameters
Overrides:
restoreState in class com.ibm.ulc.ui.UIProxy