com.ibm.ulc.ui.dataTypes
Class UINumberValidator

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

public class UINumberValidator
extends UIDataType

See Also:
Serialized Form

Field Summary
protected  IStringConverter fConverter
          The converter used to pass from String to Object and vice versa.
static int JAVA_LANG_STYLE
          The formatting/converting style defined by the classes Double, Integer, FloatingDecimal
static int JAVA_TEXT_STYLE
          The formating/converting style defined by the class NumberFormat
protected static java.lang.String validChars
          Allowed input characters
 
Fields inherited from class com.ibm.ulc.ui.UIProxy
fConnection, fId, fList, fOptionalEvents, fProxyParent
 
Constructor Summary
UINumberValidator()
          UINumberValidator 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 range specified.
 java.lang.String convertToString(java.lang.Object object, boolean forEditing)
          Return the String represenation of the object or the empty string if object is null.
 java.lang.String filterInput(java.lang.String newString)
          The default implementation returns original string without modification.
 boolean hasValidCharacters(java.lang.String s)
          Ensure that the given string has no invalid characters.
 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
filterInput, filterInput, getCols, getDefaultValue
 
Methods inherited from class com.ibm.ulc.ui.UIProxy
add, add, addInstance, addMany, cachedResources, convert, convert, enableOptionalEvents, finalize, find, free, getApplication, getChildren, getConnection, getId, getManaged, getManaged, getProxyParent, getUI, handleRequest, internalAddToChildren, internalRemoveFromChildren, isChildOf, isChildWidget, isOptionalEventEnabled, isParentOf, newUpdate, printInstances, remove, remove, removeInstance, removeMany, sendEventULC, sendEventULC, sendEventULC, sendOptionalEventULC, sendOptionalEventULC, sendOptionalEventULC, sendULC, sendULC, setConnectionAndId, setOptionalEvents, setOptionalEventsEnabled, setProxyParent, trouble, updateCachedResource
 
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

fConverter

protected IStringConverter fConverter
The converter used to pass from String to Object and vice versa.

validChars

protected static java.lang.String validChars
Allowed input characters

JAVA_LANG_STYLE

public static final int JAVA_LANG_STYLE
The formatting/converting style defined by the classes Double, Integer, FloatingDecimal

JAVA_TEXT_STYLE

public static final int JAVA_TEXT_STYLE
The formating/converting style defined by the class NumberFormat
Constructor Detail

UINumberValidator

public UINumberValidator()
UINumberValidator 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 range specified. Throw an exception on error.
Overrides:
convertToObject in class UIDataType
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.
See Also:
IDataType.convertToObject(int, String, Object)

convertToString

public java.lang.String convertToString(java.lang.Object object,
                                        boolean forEditing)
Return the String represenation of the object or the empty string if object is null. There are 2 possible cases: 1. we are in edit mode (forEditing==true), then object is the entered String, and its string representation is the String itself. 2. we are not in edit mode (forEditing==false), then the string representation is computed by fConverter
Overrides:
convertToString in class UIDataType
See Also:
IDataType.convertToString(Object, boolean)

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)

hasValidCharacters

public boolean hasValidCharacters(java.lang.String s)
Ensure that the given string has no invalid characters.
See Also:
IDataType.filterInput(String)

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.
Overrides:
restoreState in class com.ibm.ulc.ui.UIProxy
Parameters:
conn - the UlcConnection in which this operation is performed
args - the Anything containing the optional initialization parameters