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.
-
fieldDateSeparator
-
-
fieldFourDigitYear
-
-
fieldTwoDigitCenturyCutOff
-
-
fieldUSFormat
-
-
format
-
-
ivjTextAsDate
-
-
ivjTextAsSQLDate
-
-
ivjTextAsString
-
-
javaVendor
-
-
maxDaysOfMonth
-
-
propertyChange
-
-
BSDateTextField()
- Constructor
-
BSDateTextField(int)
- BSDateTextField constructor comment.
-
BSDateTextField(String)
- BSDateTextField constructor comment.
-
BSDateTextField(String, int)
- BSDateTextField constructor comment.
-
addPropertyChangeListener(PropertyChangeListener)
- The addPropertyChangeListener method was generated to support the propertyChange field.
-
conn0(TextEvent)
- conn0
-
conn2(FocusEvent)
- conn2
-
enforceMask(String)
- This method ensures that the value entered by the user into the
TextField conforms to a java Date and the 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.
-
getDateSeparator()
- Gets the dateSeparator property (char) value.
-
getFormat()
- This method is used to calculate the desired date format for the TextField
based on the bean properties.
-
getFormatDate()
- This method is used to calculate the desired date format for the TextField
based on the bean properties.
-
getFourDigitYear()
- Gets the fourDigitYear property (boolean) value.
-
getNullString()
- This method calculates the initial String displayed in the TextField.
-
getTextAsDate()
- Return the TextAsDate property value.
-
getTextAsSQLDate()
- Return the TextAsSQLDate property value.
-
getTextAsString()
- Return the TextAsString property value.
-
getTwoDigitCenturyCutOff()
- Gets the twoDigitCenturyCutOff property (int) value.
-
getUSFormat()
- Gets the USFormat property (boolean) value.
-
handleException(Throwable)
- Called whenever the part throws an exception.
-
initConnections()
- Initializes connections
-
initialize()
- Initialize class
-
removePropertyChangeListener(PropertyChangeListener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
-
setCaretPosition(int)
- Sets the position of the text insertion caret for the TextComponent
-
setDateSeparator(char)
- Sets the dateSeparator property (char) value.
-
setFourDigitYear(boolean)
- Sets the fourDigitYear property (boolean) value.
-
setTextAsDate(Date)
- Set the TextAsDate to a new value.
-
setTextAsSQLDate(Date)
- Set the TextAsSQLDate to a new value.
-
setTextAsString(String)
- Set the TextAsString to a new value.
-
setTwoDigitCenturyCutOff(int)
- Sets the twoDigitCenturyCutOff property (int) value.
-
setUSFormat(boolean)
- Sets the USFormat property (boolean) value.
-
textValueChanged(TextEvent)
- Method to handle events for the TextListener interface.
fieldDateSeparator
protected char fieldDateSeparator
fieldFourDigitYear
protected boolean fieldFourDigitYear
fieldTwoDigitCenturyCutOff
protected int fieldTwoDigitCenturyCutOff
fieldUSFormat
protected boolean fieldUSFormat
format
protected Vector format
ivjTextAsDate
protected Date ivjTextAsDate
ivjTextAsSQLDate
protected Date ivjTextAsSQLDate
ivjTextAsString
protected String ivjTextAsString
javaVendor
protected String javaVendor
maxDaysOfMonth
protected int maxDaysOfMonth[]
propertyChange
protected transient PropertyChangeSupport propertyChange
BSDateTextField
public BSDateTextField()
- Constructor
BSDateTextField
public BSDateTextField(int columns)
- BSDateTextField constructor comment.
- Parameters:
- columns - int
BSDateTextField
public BSDateTextField(String text)
- BSDateTextField constructor comment.
- Parameters:
- text - java.lang.String
BSDateTextField
public BSDateTextField(String text,
int columns)
- BSDateTextField 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
conn0
private void conn0(TextEvent arg1)
- conn0
- Parameters:
- arg1 - java.awt.event.TextEvent
conn2
private void conn2(FocusEvent arg1)
- conn2
- 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 a java Date and the 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
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
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
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[]
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
getNullString
protected StringBuffer getNullString()
- This method calculates the initial String displayed in the TextField.
- Returns:
- java.lang.StringBuffer
getTextAsDate
public Date getTextAsDate()
- Return the TextAsDate property value.
- Returns:
- java.util.Date
getTextAsSQLDate
public Date getTextAsSQLDate()
- Return the TextAsSQLDate property value.
- Returns:
- java.sql.Date
getTextAsString
public String getTextAsString()
- Return the TextAsString property value.
Returns the same as getText().
- Returns:
- java.lang.String
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
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
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
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- The removePropertyChangeListener method was generated to support the propertyChange field.
- Parameters:
- listener - java.beans.PropertyChangeListener
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
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
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
setTextAsDate
private void setTextAsDate(Date newValue)
- Set the TextAsDate to a new value.
- Parameters:
- newValue - java.util.Date
setTextAsSQLDate
private void setTextAsSQLDate(Date newValue)
- Set the TextAsSQLDate to a new value.
- Parameters:
- newValue - java.sql.Date
setTextAsString
private void setTextAsString(String newValue)
- Set the TextAsString to a new value.
- Parameters:
- newValue - java.lang.String
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
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
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