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().
-
fieldCanBeIncomplete
-
-
fieldDesignatedAlphaCharacter
-
-
fieldDesignatedAlphaNumericCharacter
-
-
fieldDesignatedAnyCharacter
-
-
fieldDesignatedAnyCharacterFromSpecialCharacters
-
-
fieldDesignatedNumericCharacter
-
-
fieldMask
-
-
fieldSpecialCharacters
-
-
fieldSpecialCharactersInReturnString
-
-
ivjTextAsLong
-
-
ivjTextAsString
-
-
javaVendor
-
-
propertyChange
-
-
BSMaskedTextField()
- Constructor
-
BSMaskedTextField(int)
- BSMaskedTextField constructor comment.
-
BSMaskedTextField(String)
- BSMaskedTextField constructor comment.
-
BSMaskedTextField(String, int)
- BSMaskedTextField constructor comment.
-
addPropertyChangeListener(PropertyChangeListener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
-
checkCaretPosition()
- This method calculates the caret position of the TextField under
exceptional conditions.
-
conn0(TextEvent)
- conn0
-
conn2(PropertyChangeEvent)
- conn2
-
conn4(FocusEvent)
- conn4
-
enforceMask(String)
- This method ensures that the value entered by the user into the
TextField conforms to the mask and the other properties set.
-
firePropertyChange(String, Object, Object)
- The firePropertyChange method was generated to support the propertyChange field.
-
focusGained(FocusEvent)
- Method to handle events for the FocusListener interface.
-
focusLost(FocusEvent)
- Method to handle events for the FocusListener interface.
-
getCanBeIncomplete()
- Gets the canBeIncomplete property (boolean) value.
-
getDesignatedAlphaCharacter()
- Gets the designatedAlphaCharacter property (char) value.
-
getDesignatedAlphaNumericCharacter()
- Gets the designatedAlphaNumericCharacter property (char) value.
-
getDesignatedAnyCharacter()
- Gets the designatedAnyCharacter property (char) value.
-
getDesignatedAnyCharacterFromSpecialCharacters()
- Gets the designatedAnyCharacterFromSpecialCharacters property (char) value.
-
getDesignatedNumericCharacter()
- Gets the designatedNumericCharacter property (char) value.
-
getIntegerValue(String)
- This method calculates the integer value of the text in the TextField and
returns it as a Long object.
-
getMask()
- Gets the mask property (java.lang.String) value.
-
getSpecialCharacters()
- Gets the specialCharacters property (char[]) value.
-
getSpecialCharactersInReturnString()
- Gets the specialCharactersInReturnString property (boolean) value.
-
getTextAs_long()
- Return the TextAsLong as a long value.
-
getTextAsInteger()
- Method generated to support the promotion of the textAsInteger attribute.
-
getTextAsLong()
- Return the TextAsLong property value.
-
getTextAsString()
- Return the TextAsString property value.
-
handleException(Throwable)
- Called whenever the part throws an exception.
-
initConnections()
- Initializes connections
-
initialize()
- Initialize class
-
propertyChange(PropertyChangeEvent)
- Method to handle events for the PropertyChangeListener interface.
-
removeChars(String, char[])
- This method is used to remove an array of characters from a String.
-
removeChars(StringBuffer, char[])
- This method is used to remove an array of characters from a String.
-
removePropertyChangeListener(PropertyChangeListener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
-
setCanBeIncomplete(boolean)
- Sets the canBeIncomplete property (boolean) value.
-
setCaretPosition(int)
- Sets the position of the text insertion caret for the TextComponent
-
setDesignatedAlphaCharacter(char)
- Sets the designatedAlphaCharacter property (char) value.
-
setDesignatedAlphaNumericCharacter(char)
- Sets the designatedAlphaNumericCharacter property (char) value.
-
setDesignatedAnyCharacter(char)
- Sets the designatedAnyCharacter property (char) value.
-
setDesignatedAnyCharacterFromSpecialCharacters(char)
- Sets the designatedAnyCharacterFromSpecialCharacters property (char) value.
-
setDesignatedNumericCharacter(char)
- Sets the designatedNumericCharacter property (char) value.
-
setMask(String)
- Sets the mask property (java.lang.String) value.
-
setSpecialCharacters(char[])
- Sets the specialCharacters property (char[]) value.
-
setSpecialCharactersInReturnString(boolean)
- Sets the specialCharactersInReturnString property (boolean) value.
-
setTextAsLong(Long)
- Set the TextAsLong to a new value.
-
setTextAsString(String)
- Set the TextAsString to a new value.
-
textAs_int()
- Returns the Long value of the TextField as a java primitive.
-
textValueChanged(TextEvent)
- Method to handle events for the TextListener interface.
fieldCanBeIncomplete
protected boolean fieldCanBeIncomplete
fieldDesignatedAlphaCharacter
protected char fieldDesignatedAlphaCharacter
fieldDesignatedAlphaNumericCharacter
protected char fieldDesignatedAlphaNumericCharacter
fieldDesignatedAnyCharacter
protected char fieldDesignatedAnyCharacter
fieldDesignatedAnyCharacterFromSpecialCharacters
protected char fieldDesignatedAnyCharacterFromSpecialCharacters
fieldDesignatedNumericCharacter
protected char fieldDesignatedNumericCharacter
fieldMask
protected String fieldMask
fieldSpecialCharacters
protected char fieldSpecialCharacters[]
fieldSpecialCharactersInReturnString
protected boolean fieldSpecialCharactersInReturnString
ivjTextAsLong
private Long ivjTextAsLong
ivjTextAsString
private String ivjTextAsString
javaVendor
protected String javaVendor
propertyChange
protected transient PropertyChangeSupport propertyChange
BSMaskedTextField
public BSMaskedTextField()
- Constructor
BSMaskedTextField
public BSMaskedTextField(int columns)
- BSMaskedTextField constructor comment.
- Parameters:
- columns - int
BSMaskedTextField
public BSMaskedTextField(String text)
- BSMaskedTextField constructor comment.
- Parameters:
- text - java.lang.String
BSMaskedTextField
public BSMaskedTextField(String text,
int columns)
- BSMaskedTextField constructor comment.
- Parameters:
- text - java.lang.String
- columns - int
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
checkCaretPosition
private void checkCaretPosition()
- This method calculates the caret position of the TextField under
exceptional conditions.
conn0
private void conn0(TextEvent arg1)
- conn0
- Parameters:
- arg1 - java.awt.event.TextEvent
conn2
private void conn2(PropertyChangeEvent arg1)
- conn2
- Parameters:
- arg1 - java.beans.PropertyChangeEvent
conn4
private void conn4(FocusEvent arg1)
- conn4
- Parameters:
- arg1 - java.awt.event.FocusEvent
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
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
focusGained
public void focusGained(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
focusLost
public void focusLost(FocusEvent e)
- Method to handle events for the FocusListener interface.
- Parameters:
- e - java.awt.event.FocusEvent
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
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
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
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
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
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
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
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
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
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
getTextAs_long
public long getTextAs_long()
- Return the TextAsLong as a long value.
- Returns:
- long
getTextAsInteger
public Long getTextAsInteger()
- Method generated to support the promotion of the textAsInteger attribute.
- Returns:
- java.lang.Long
- See Also:
- getTextAsLong
getTextAsLong
public Long getTextAsLong()
- Return the TextAsLong property value.
- Returns:
- java.lang.Long
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
handleException
private void handleException(Throwable exception)
- Called whenever the part throws an exception.
- Parameters:
- exception - java.lang.Throwable
initConnections
private void initConnections()
- Initializes connections
initialize
private void initialize()
- Initialize class
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Method to handle events for the PropertyChangeListener interface.
- Parameters:
- evt - java.beans.PropertyChangeEvent
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
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
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
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
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
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
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
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
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
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
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
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
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
setTextAsLong
private void setTextAsLong(Long newValue)
- Set the TextAsLong to a new value.
- Parameters:
- newValue - java.lang.Long
setTextAsString
private void setTextAsString(String newValue)
- Set the TextAsString to a new value.
- Parameters:
- newValue - java.lang.String
textAs_int
public int textAs_int()
- Returns the Long value of the TextField as a java primitive.
- Returns:
- int
- See Also:
- getTextAsLong
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