com.ibm.ulc.ui.dataTypes
Class UIDataType

java.lang.Object
  |
  +--com.ibm.ulc.util.UlcObject
        |
        +--com.ibm.ulc.ui.UIProxy
              |
              +--com.ibm.ulc.ui.dataTypes.UIDataType
Direct Known Subclasses:
UIDateValidator, UINumberValidator, UIPercentValidator, UIRangeValidator, UIRegularExpressionValidator, UIStringFormatter

public class UIDataType
extends com.ibm.ulc.ui.UIProxy
implements IDataType

See Also:
Serialized Form

Fields inherited from class com.ibm.ulc.ui.UIProxy
fConnection, fId, fList, fOptionalEvents, fProxyParent
 
Constructor Summary
UIDataType()
          Default constructor for the receiver
 
Method Summary
 java.lang.Object convertToObject(int phase, java.lang.String newString, java.lang.Object previousValue)
          The default implementation returns the fields string as an object.
 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(int position, java.lang.String newString, java.lang.String currentText, javax.swing.text.AttributeSet attribute)
          Hook to filter any text input into the field.
 java.lang.String filterInput(java.lang.String newString)
          The default implementation returns original string without modification.
 java.lang.String filterInput(java.lang.String newString, java.lang.String currentText)
          Hook to filter any text input into the field.
 int getCols()
          Returns the default width (in characters) used to determine the size of a field or table and list column of this DataType.
 java.lang.Object getDefaultValue(java.lang.String newString)
          Returns the default object to be returned when a data conversion error occurs.
 
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, restoreState, 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
 

Constructor Detail

UIDataType

public UIDataType()
Default constructor for the receiver
Method Detail

convertToObject

public java.lang.Object convertToObject(int phase,
                                        java.lang.String newString,
                                        java.lang.Object previousValue)
                                 throws DataTypeConversionException
The default implementation returns the fields string as an object. Subclasses should override this method to return the configured data type.
Specified by:
convertToObject in interface IDataType
Parameters:
phase - int The current validation phase. The phase can be one of the following:
	FORM_NOTIFICATION_IMMEDIATE : 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. The default implementation calls the toString() to return a string representation of the object. Subclasses should override this method to return the formatted data type as a String.
Specified by:
convertToString in interface IDataType
See Also:
IDataType.convertToString(Object, boolean)

filterInput

public java.lang.String filterInput(int position,
                                    java.lang.String newString,
                                    java.lang.String currentText,
                                    javax.swing.text.AttributeSet attribute)
Hook to filter any text input into the field.
Specified by:
filterInput in interface IDataType
Parameters:
position - The location where the input is being inserted
newString - The string to filter.
currentText - The current Contents.
attribute - The attributes of the text being inserted
Returns:
the filtered result, If null input is not accepted.
See Also:
IDataType.filterInput(String, String)

filterInput

public java.lang.String filterInput(java.lang.String newString)
The default implementation returns original string without modification.
Specified by:
filterInput in interface IDataType
See Also:
IDataType.filterInput(String)

filterInput

public java.lang.String filterInput(java.lang.String newString,
                                    java.lang.String currentText)
Hook to filter any text input into the field.
Specified by:
filterInput in interface IDataType
Parameters:
newString - The string to filter.
currentText - The current Contents.
Returns:
the filtered result, If null input is not accepted.
See Also:
IDataType.filterInput(String, String)

getCols

public int getCols()
Returns the default width (in characters) used to determine the size of a field or table and list column of this DataType. Can be overidden by giving the field an explicit size.
Specified by:
getCols in interface IDataType

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.String newString)
Returns the default object to be returned when a data conversion error occurs.
Specified by:
getDefaultValue in interface IDataType