All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.BSMaskedTextFields.BSMaskedTextField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----COM.BSMaskedTextFields.BSMaskedTextField

public class BSMaskedTextField
extends TextField
implements FocusListener, TextListener, PropertyChangeListener
A TextField which only allows its input to be that which conforms to a mask.

These bean properties can be used to modify the format the TextField will enforce: canBeIncomplete, designatedAlphaCharacter, designatedAlphaNumericCharacter, designatedAnyCharacter, designatedAnyCharacterFromSpecialCharacters, designatedNumericCharacter, mask, specialCharacters, and specialCharactersInReturnString.

canBeIncomplete: Whether or not this TextField should return a String value when the mask is not fully complete. If the value is true the text value will be returned, if the value is false this TextField will return an empty String ("") whenever asked for its text value until the mask is completely filled.

designatedAlphaCharacter: The character which designates any alpha character, according to the unicode standard, in the mask enforced upon this TextField.

designatedAlphaNumericCharacter: The character which designates any alpha or numeric character, according to the unicode standard, in the mask enforced upon this TextField. designatedAnyCharacter: The character which designates any character in the mask enforced upon this TextField.

designatedAnyCharacterFromSpecialCharacters: The character which designates any character from the specialCharacters array in the mask enforced upon this TextField.

designatedNumericCharacter: The character which designates any numeric character, according to the unicode standard, in the mask enforced upon this TextField.

mask: A String, made up of designatedCharacters and specialCharacters. The mask String indicates how the format of this TextField will be enforced.

specialCharacters: An array of the special characters included in the mask.

specialCharactersInReturnString: Whether or not characters in the specialCharacters array should appear in the String representation returned from the getTextAsString() method, if the value is false the getTextAsString() method will return the same value as getText().


Variable Index

 o fieldCanBeIncomplete
 o fieldDesignatedAlphaCharacter
 o fieldDesignatedAlphaNumericCharacter
 o fieldDesignatedAnyCharacter
 o fieldDesignatedAnyCharacterFromSpecialCharacters
 o fieldDesignatedNumericCharacter
 o fieldMask
 o fieldSpecialCharacters
 o fieldSpecialCharactersInReturnString
 o ivjTextAsLong
 o ivjTextAsString
 o javaVendor
 o propertyChange

Constructor Index

 o BSMaskedTextField()
Constructor
 o BSMaskedTextField(int)
BSMaskedTextField constructor comment.
 o BSMaskedTextField(String)
BSMaskedTextField constructor comment.
 o BSMaskedTextField(String, int)
BSMaskedTextField constructor comment.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
The addPropertyChangeListener method was generated to support the propertyChange field.
 o checkCaretPosition()
This method calculates the caret position of the TextField under exceptional conditions.
 o conn0(TextEvent)
conn0
 o conn2(PropertyChangeEvent)
conn2
 o conn4(FocusEvent)
conn4
 o enforceMask(String)
This method ensures that the value entered by the user into the TextField conforms to the mask and the other properties set.
 o firePropertyChange(String, Object, Object)
The firePropertyChange method was generated to support the propertyChange field.
 o focusGained(FocusEvent)
Method to handle events for the FocusListener interface.
 o focusLost(FocusEvent)
Method to handle events for the FocusListener interface.
 o getCanBeIncomplete()
Gets the canBeIncomplete property (boolean) value.
 o getDesignatedAlphaCharacter()
Gets the designatedAlphaCharacter property (char) value.
 o getDesignatedAlphaNumericCharacter()
Gets the designatedAlphaNumericCharacter property (char) value.
 o getDesignatedAnyCharacter()
Gets the designatedAnyCharacter property (char) value.
 o getDesignatedAnyCharacterFromSpecialCharacters()
Gets the designatedAnyCharacterFromSpecialCharacters property (char) value.
 o getDesignatedNumericCharacter()
Gets the designatedNumericCharacter property (char) value.
 o getIntegerValue(String)
This method calculates the integer value of the text in the TextField and returns it as a Long object.
 o getMask()
Gets the mask property (java.lang.String) value.
 o getSpecialCharacters()
Gets the specialCharacters property (char[]) value.
 o getSpecialCharactersInReturnString()
Gets the specialCharactersInReturnString property (boolean) value.
 o getTextAs_long()
Return the TextAsLong as a long value.
 o getTextAsInteger()
Method generated to support the promotion of the textAsInteger attribute.
 o getTextAsLong()
Return the TextAsLong property value.
 o getTextAsString()
Return the TextAsString property value.
 o handleException(Throwable)
Called whenever the part throws an exception.
 o initConnections()
Initializes connections
 o initialize()
Initialize class
 o propertyChange(PropertyChangeEvent)
Method to handle events for the PropertyChangeListener interface.
 o removeChars(String, char[])
This method is used to remove an array of characters from a String.
 o removeChars(StringBuffer, char[])
This method is used to remove an array of characters from a String.
 o removePropertyChangeListener(PropertyChangeListener)
The removePropertyChangeListener method was generated to support the propertyChange field.
 o setCanBeIncomplete(boolean)
Sets the canBeIncomplete property (boolean) value.
 o setCaretPosition(int)
Sets the position of the text insertion caret for the TextComponent
 o setDesignatedAlphaCharacter(char)
Sets the designatedAlphaCharacter property (char) value.
 o setDesignatedAlphaNumericCharacter(char)
Sets the designatedAlphaNumericCharacter property (char) value.
 o setDesignatedAnyCharacter(char)
Sets the designatedAnyCharacter property (char) value.
 o setDesignatedAnyCharacterFromSpecialCharacters(char)
Sets the designatedAnyCharacterFromSpecialCharacters property (char) value.
 o setDesignatedNumericCharacter(char)
Sets the designatedNumericCharacter property (char) value.
 o setMask(String)
Sets the mask property (java.lang.String) value.
 o setSpecialCharacters(char[])
Sets the specialCharacters property (char[]) value.
 o setSpecialCharactersInReturnString(boolean)
Sets the specialCharactersInReturnString property (boolean) value.
 o setTextAsLong(Long)
Set the TextAsLong to a new value.
 o setTextAsString(String)
Set the TextAsString to a new value.
 o textAs_int()
Returns the Long value of the TextField as a java primitive.
 o textValueChanged(TextEvent)
Method to handle events for the TextListener interface.

Variables

 o fieldCanBeIncomplete
 protected boolean fieldCanBeIncomplete
 o fieldDesignatedAlphaCharacter
 protected char fieldDesignatedAlphaCharacter
 o fieldDesignatedAlphaNumericCharacter
 protected char fieldDesignatedAlphaNumericCharacter
 o fieldDesignatedAnyCharacter
 protected char fieldDesignatedAnyCharacter
 o fieldDesignatedAnyCharacterFromSpecialCharacters
 protected char fieldDesignatedAnyCharacterFromSpecialCharacters
 o fieldDesignatedNumericCharacter
 protected char fieldDesignatedNumericCharacter
 o fieldMask
 protected String fieldMask
 o fieldSpecialCharacters
 protected char fieldSpecialCharacters[]
 o fieldSpecialCharactersInReturnString
 protected boolean fieldSpecialCharactersInReturnString
 o ivjTextAsLong
 private Long ivjTextAsLong
 o ivjTextAsString
 private String ivjTextAsString
 o javaVendor
 protected String javaVendor
 o propertyChange
 protected transient PropertyChangeSupport propertyChange

Constructors

 o BSMaskedTextField
 public BSMaskedTextField()
Constructor

 o BSMaskedTextField
 public BSMaskedTextField(int columns)
BSMaskedTextField constructor comment.

Parameters:
columns - int
 o BSMaskedTextField
 public BSMaskedTextField(String text)
BSMaskedTextField constructor comment.

Parameters:
text - java.lang.String
 o BSMaskedTextField
 public BSMaskedTextField(String text,
                          int columns)
BSMaskedTextField constructor comment.

Parameters:
text - java.lang.String
columns - int

Methods

 o addPropertyChangeListener
 public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
The addPropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o checkCaretPosition
 private void checkCaretPosition()
This method calculates the caret position of the TextField under exceptional conditions.

 o conn0
 private void conn0(TextEvent arg1)
conn0

Parameters:
arg1 - java.awt.event.TextEvent
 o conn2
 private void conn2(PropertyChangeEvent arg1)
conn2

Parameters:
arg1 - java.beans.PropertyChangeEvent
 o conn4
 private void conn4(FocusEvent arg1)
conn4

Parameters:
arg1 - java.awt.event.FocusEvent
 o enforceMask
 protected void enforceMask(String str)
This method ensures that the value entered by the user into the TextField conforms to the mask and the other properties set.

Parameters:
str - java.lang.String
 o firePropertyChange
 public void firePropertyChange(String propertyName,
                                Object oldValue,
                                Object newValue)
The firePropertyChange method was generated to support the propertyChange field.

Parameters:
propertyName - java.lang.String
oldValue - java.lang.Object
newValue - java.lang.Object
 o focusGained
 public void focusGained(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o focusLost
 public void focusLost(FocusEvent e)
Method to handle events for the FocusListener interface.

Parameters:
e - java.awt.event.FocusEvent
 o getCanBeIncomplete
 public boolean getCanBeIncomplete()
Gets the canBeIncomplete property (boolean) value. This value indicates whether or not this TextField should return a String value when the mask is not fully complete. If the value is true the text value will be returned, if the value is false this TextField will return an empty String ("") whenever asked for its text value until the mask is completely filled.

Returns:
The canBeIncomplete property value.
See Also:
setCanBeIncomplete
 o getDesignatedAlphaCharacter
 public char getDesignatedAlphaCharacter()
Gets the designatedAlphaCharacter property (char) value. The character which designates any alpha character, according to the unicode standard, in the mask enforced upon this TextField.

Returns:
The designatedAlphaCharacter property value.
See Also:
setDesignatedAlphaCharacter
 o getDesignatedAlphaNumericCharacter
 public char getDesignatedAlphaNumericCharacter()
Gets the designatedAlphaNumericCharacter property (char) value. The character which designates any alpha or numeric character, according to the unicode standard, in the mask enforced upon this TextField.

Returns:
The designatedAlphaNumericCharacter property value.
See Also:
setDesignatedAlphaNumericCharacter
 o getDesignatedAnyCharacter
 public char getDesignatedAnyCharacter()
Gets the designatedAnyCharacter property (char) value. The character which designates any character in the mask enforced upon this TextField.

Returns:
The designatedAnyCharacter property value.
See Also:
setDesignatedAnyCharacter
 o getDesignatedAnyCharacterFromSpecialCharacters
 public char getDesignatedAnyCharacterFromSpecialCharacters()
Gets the designatedAnyCharacterFromSpecialCharacters property (char) value. The character which designates any character from the specialCharacters array in the mask enforced upon this TextField.

Returns:
The designatedAnyCharacterFromSpecialCharacters property value.
See Also:
setDesignatedAnyCharacterFromSpecialCharacters
 o getDesignatedNumericCharacter
 public char getDesignatedNumericCharacter()
Gets the designatedNumericCharacter property (char) value. The character which designates any numeric character, according to the unicode standard, in the mask enforced upon this TextField.

Returns:
The designatedNumericCharacter property value.
See Also:
setDesignatedNumericCharacter
 o getIntegerValue
 protected Long getIntegerValue(String str)
This method calculates the integer value of the text in the TextField and returns it as a Long object.

Parameters:
str - java.lang.String
Returns:
java.lang.Long
 o getMask
 public String getMask()
Gets the mask property (java.lang.String) value. This value is the String, made up of designatedCharacters and specialCharacters. The mask String indicates how the format of this TextField will be enforced.

Returns:
The mask property value.
See Also:
setMask
 o getSpecialCharacters
 public char[] getSpecialCharacters()
Gets the specialCharacters property (char[]) value. The value is an array of the special characters included in the mask.

Returns:
The specialCharacters property value.
See Also:
setSpecialCharacters
 o getSpecialCharactersInReturnString
 public boolean getSpecialCharactersInReturnString()
Gets the specialCharactersInReturnString property (boolean) value. This value indicates whether or not characters in the specialCharacters array should appear in the String representation returned from the getTextAsString() method, if the value is false the getTextAsString() method will return the same value as getText().

Returns:
The specialCharactersInReturnString property value.
See Also:
setSpecialCharactersInReturnString
 o getTextAs_long
 public long getTextAs_long()
Return the TextAsLong as a long value.

Returns:
long
 o getTextAsInteger
 public Long getTextAsInteger()
Method generated to support the promotion of the textAsInteger attribute.

Returns:
java.lang.Long
See Also:
getTextAsLong
 o getTextAsLong
 public Long getTextAsLong()
Return the TextAsLong property value.

Returns:
java.lang.Long
 o getTextAsString
 public String getTextAsString()
Return the TextAsString property value. Value returned may be the same as the getText method or different, this is dependant upon the setting of the specialCharactersInReturnString property.

Returns:
java.lang.String
See Also:
setSpecialCharactersInReturnString
 o handleException
 private void handleException(Throwable exception)
Called whenever the part throws an exception.

Parameters:
exception - java.lang.Throwable
 o initConnections
 private void initConnections()
Initializes connections

 o initialize
 private void initialize()
Initialize class

 o propertyChange
 public void propertyChange(PropertyChangeEvent evt)
Method to handle events for the PropertyChangeListener interface.

Parameters:
evt - java.beans.PropertyChangeEvent
 o removeChars
 protected String removeChars(String text,
                              char chars[])
This method is used to remove an array of characters from a String.

Parameters:
text - java.lang.String
chars - char[]
Returns:
java.lang.String
 o removeChars
 protected String removeChars(StringBuffer text,
                              char chars[])
This method is used to remove an array of characters from a String.

Parameters:
text - java.lang.StringBuffer
chars - char[]
Returns:
java.lang.String
 o removePropertyChangeListener
 public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 o setCanBeIncomplete
 public void setCanBeIncomplete(boolean canBeIncomplete)
Sets the canBeIncomplete property (boolean) value. This value indicates whether or not this TextField should return a String value when the mask is not fully complete. If the value is true the text value will be returned, if the value is false this TextField will return an empty String ("") whenever asked for its text value until the mask is completely filled.

Parameters:
canBeIncomplete - The new value for the property.
See Also:
getCanBeIncomplete
 o setCaretPosition
 public void setCaretPosition(int position)
Sets the position of the text insertion caret for the TextComponent

Parameters:
position - the position
Throws: IllegalArgumentException
If position is less than 0.
Overrides:
setCaretPosition in class TextComponent
 o setDesignatedAlphaCharacter
 public void setDesignatedAlphaCharacter(char designatedAlphaCharacter)
Sets the designatedAlphaCharacter property (char) value. The character which designates any alpha character, according to the unicode standard, in the mask enforced upon this TextField.

Parameters:
designatedAlphaCharacter - The new value for the property.
See Also:
getDesignatedAlphaCharacter
 o setDesignatedAlphaNumericCharacter
 public void setDesignatedAlphaNumericCharacter(char designatedAlphaNumericCharacter)
Sets the designatedAlphaNumericCharacter property (char) value. The character which designates any alpha or numeric character, according to the unicode standard, in the mask enforced upon this TextField.

Parameters:
designatedAlphaNumericCharacter - The new value for the property.
See Also:
getDesignatedAlphaNumericCharacter
 o setDesignatedAnyCharacter
 public void setDesignatedAnyCharacter(char designatedAnyCharacter)
Sets the designatedAnyCharacter property (char) value. The character which designates any character in the mask enforced upon this TextField.

Parameters:
designatedAnyCharacter - The new value for the property.
See Also:
getDesignatedAnyCharacter
 o setDesignatedAnyCharacterFromSpecialCharacters
 public void setDesignatedAnyCharacterFromSpecialCharacters(char designatedAnyCharacterFromSpecialCharacters)
Sets the designatedAnyCharacterFromSpecialCharacters property (char) value. The character which designates any character from the specialCharacters array in the mask enforced upon this TextField.

Parameters:
designatedAnyCharacterFromSpecialCharacters - The new value for the property.
See Also:
getDesignatedAnyCharacterFromSpecialCharacters
 o setDesignatedNumericCharacter
 public void setDesignatedNumericCharacter(char designatedNumericCharacter)
Sets the designatedNumericCharacter property (char) value. The character which designates any numeric character, according to the unicode standard, in the mask enforced upon this TextField.

Parameters:
designatedNumericCharacter - The new value for the property.
See Also:
getDesignatedNumericCharacter
 o setMask
 public void setMask(String mask)
Sets the mask property (java.lang.String) value. This value is the String, made up of designatedCharacters and specialCharacters. The mask String indicates how the format of this TextField will be enforced.

Parameters:
mask - The new value for the property.
See Also:
getMask
 o setSpecialCharacters
 public void setSpecialCharacters(char specialCharacters[])
Sets the specialCharacters property (char[]) value. The value is an array of the special characters included in the mask.

Parameters:
specialCharacters - The new value for the property.
See Also:
getSpecialCharacters
 o setSpecialCharactersInReturnString
 public void setSpecialCharactersInReturnString(boolean specialCharactersInReturnString)
Sets the specialCharactersInReturnString property (boolean) value. This value indicates whether or not characters in the specialCharacters array should appear in the String representation returned from the getTextAsString() method, if the value is false the getTextAsString() method will return the same value as getText().

Parameters:
specialCharactersInReturnString - The new value for the property.
See Also:
getSpecialCharactersInReturnString
 o setTextAsLong
 private void setTextAsLong(Long newValue)
Set the TextAsLong to a new value.

Parameters:
newValue - java.lang.Long
 o setTextAsString
 private void setTextAsString(String newValue)
Set the TextAsString to a new value.

Parameters:
newValue - java.lang.String
 o textAs_int
 public int textAs_int()
Returns the Long value of the TextField as a java primitive.

Returns:
int
See Also:
getTextAsLong
 o textValueChanged
 public void textValueChanged(TextEvent e)
Method to handle events for the TextListener interface.

Parameters:
e - java.awt.event.TextEvent

All Packages  Class Hierarchy  This Package  Previous  Next  Index