All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.BSMaskedTextFields.BSDateTextField

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

public class BSDateTextField
extends TextField
implements FocusListener, TextListener
A TextField which only allows its input to be a complete date.

These bean properties can be used to modify the date format the TextField will enforce: dateSeparator, fourDigitYear, twoDigitCenturyCutOff, and USFormat.

dateSeparator: The character which separates the month, day, and year, in the String representation of the date.

fourDigitYear: Whether or not the year should be displayed as a four digit integer, setting this boolean property to false will cause the year to be displayed as a two digit integer.

twoDigitCenturyCutOff: A four digit year, important when the fourDigitYear property is set to false. When a two digit year is entered with a value less than the last two digits of this value the year will be assumed to be of the next century, if the two digit year value is greater than the last two digits of this value the year will be assumed to be of the same century as this value.

USFormat: A boolean value, when set to true the date format is MM-DD-Year. When set to false the date format is DD-MM-Year.


Variable Index

 o fieldDateSeparator
 o fieldFourDigitYear
 o fieldTwoDigitCenturyCutOff
 o fieldUSFormat
 o format
 o ivjTextAsDate
 o ivjTextAsSQLDate
 o ivjTextAsString
 o javaVendor
 o maxDaysOfMonth
 o propertyChange

Constructor Index

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

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
The addPropertyChangeListener method was generated to support the propertyChange field.
 o conn0(TextEvent)
conn0
 o conn2(FocusEvent)
conn2
 o enforceMask(String)
This method ensures that the value entered by the user into the TextField conforms to a java Date and the 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 getDateSeparator()
Gets the dateSeparator property (char) value.
 o getFormat()
This method is used to calculate the desired date format for the TextField based on the bean properties.
 o getFormatDate()
This method is used to calculate the desired date format for the TextField based on the bean properties.
 o getFourDigitYear()
Gets the fourDigitYear property (boolean) value.
 o getNullString()
This method calculates the initial String displayed in the TextField.
 o getTextAsDate()
Return the TextAsDate property value.
 o getTextAsSQLDate()
Return the TextAsSQLDate property value.
 o getTextAsString()
Return the TextAsString property value.
 o getTwoDigitCenturyCutOff()
Gets the twoDigitCenturyCutOff property (int) value.
 o getUSFormat()
Gets the USFormat property (boolean) value.
 o handleException(Throwable)
Called whenever the part throws an exception.
 o initConnections()
Initializes connections
 o initialize()
Initialize class
 o removePropertyChangeListener(PropertyChangeListener)
The removePropertyChangeListener method was generated to support the propertyChange field.
 o setCaretPosition(int)
Sets the position of the text insertion caret for the TextComponent
 o setDateSeparator(char)
Sets the dateSeparator property (char) value.
 o setFourDigitYear(boolean)
Sets the fourDigitYear property (boolean) value.
 o setTextAsDate(Date)
Set the TextAsDate to a new value.
 o setTextAsSQLDate(Date)
Set the TextAsSQLDate to a new value.
 o setTextAsString(String)
Set the TextAsString to a new value.
 o setTwoDigitCenturyCutOff(int)
Sets the twoDigitCenturyCutOff property (int) value.
 o setUSFormat(boolean)
Sets the USFormat property (boolean) value.
 o textValueChanged(TextEvent)
Method to handle events for the TextListener interface.

Variables

 o fieldDateSeparator
 protected char fieldDateSeparator
 o fieldFourDigitYear
 protected boolean fieldFourDigitYear
 o fieldTwoDigitCenturyCutOff
 protected int fieldTwoDigitCenturyCutOff
 o fieldUSFormat
 protected boolean fieldUSFormat
 o format
 protected Vector format
 o ivjTextAsDate
 protected Date ivjTextAsDate
 o ivjTextAsSQLDate
 protected Date ivjTextAsSQLDate
 o ivjTextAsString
 protected String ivjTextAsString
 o javaVendor
 protected String javaVendor
 o maxDaysOfMonth
 protected int maxDaysOfMonth[]
 o propertyChange
 protected transient PropertyChangeSupport propertyChange

Constructors

 o BSDateTextField
 public BSDateTextField()
Constructor

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

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

Parameters:
text - java.lang.String
 o BSDateTextField
 public BSDateTextField(String text,
                        int columns)
BSDateTextField 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 conn0
 private void conn0(TextEvent arg1)
conn0

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

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 a java Date and the 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 getDateSeparator
 public char getDateSeparator()
Gets the dateSeparator property (char) value. The dateSeparator seperates the month, day, and year, of the date.

Returns:
The dateSeparator property value.
See Also:
setDateSeparator
 o getFormat
 protected Vector getFormat()
This method is used to calculate the desired date format for the TextField based on the bean properties.

Returns:
java.util.Vector
 o getFormatDate
 protected String[] getFormatDate()
This method is used to calculate the desired date format for the TextField based on the bean properties.

Returns:
java.lang.String[]
 o getFourDigitYear
 public boolean getFourDigitYear()
Gets the fourDigitYear property (boolean) value. True indicates that four digit years are to be used, false that two digit years are to be used.

Returns:
The fourDigitYear property value.
See Also:
setFourDigitYear
 o getNullString
 protected StringBuffer getNullString()
This method calculates the initial String displayed in the TextField.

Returns:
java.lang.StringBuffer
 o getTextAsDate
 public Date getTextAsDate()
Return the TextAsDate property value.

Returns:
java.util.Date
 o getTextAsSQLDate
 public Date getTextAsSQLDate()
Return the TextAsSQLDate property value.

Returns:
java.sql.Date
 o getTextAsString
 public String getTextAsString()
Return the TextAsString property value. Returns the same as getText().

Returns:
java.lang.String
 o getTwoDigitCenturyCutOff
 public int getTwoDigitCenturyCutOff()
Gets the twoDigitCenturyCutOff property (int) value. The twoDigitCenturyCutOff is a four digit year, important when the fourDigitYear property is set to false. When a two digit year is entered with a value less than the last two digits of this value the year will be assumed to be of the next century, if the two digit year value is greater than the last two digits of this value the year will be assumed to be of the same century as this value.

Returns:
The twoDigitCenturyCutOff property value.
See Also:
setTwoDigitCenturyCutOff
 o getUSFormat
 public boolean getUSFormat()
Gets the USFormat property (boolean) value. When this value is set to true the date format is MM-DD-Year. When it is set to false the date format is DD-MM-Year.

Returns:
The USFormat property value.
See Also:
setUSFormat
 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 removePropertyChangeListener
 public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
The removePropertyChangeListener method was generated to support the propertyChange field.

Parameters:
listener - java.beans.PropertyChangeListener
 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 setDateSeparator
 public void setDateSeparator(char dateSeparator)
Sets the dateSeparator property (char) value. The dateSeparator seperates the month, day, and year, of the date.

Parameters:
dateSeparator - The new value for the property.
See Also:
getDateSeparator
 o setFourDigitYear
 public void setFourDigitYear(boolean fourDigitYear)
Sets the fourDigitYear property (boolean) value. True indicates that four digit years are to be used, false that two digit years are to be used.

Parameters:
fourDigitYear - The new value for the property.
See Also:
getFourDigitYear
 o setTextAsDate
 private void setTextAsDate(Date newValue)
Set the TextAsDate to a new value.

Parameters:
newValue - java.util.Date
 o setTextAsSQLDate
 private void setTextAsSQLDate(Date newValue)
Set the TextAsSQLDate to a new value.

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

Parameters:
newValue - java.lang.String
 o setTwoDigitCenturyCutOff
 public void setTwoDigitCenturyCutOff(int twoDigitCenturyCutOff)
Sets the twoDigitCenturyCutOff property (int) value. The twoDigitCenturyCutOff is a four digit year, important when the fourDigitYear property is set to false. When a two digit year is entered with a value less than the last two digits of this value the year will be assumed to be of the next century, if the two digit year value is greater than the last two digits of this value the year will be assumed to be of the same century as this value.

Parameters:
twoDigitCenturyCutOff - The new value for the property.
See Also:
getTwoDigitCenturyCutOff
 o setUSFormat
 public void setUSFormat(boolean USFormat)
Sets the USFormat property (boolean) value. When this value is set to true the date format is MM-DD-Year. When it is set to false the date format is DD-MM-Year.

Parameters:
USFormat - The new value for the property.
See Also:
getUSFormat
 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