Class com.symantec.itools.awt.DateMaskedField
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.awt.DateMaskedField

Object
   |
   +----Component
           |
           +----TextComponent
                   |
                   +----TextField
                           |
                           +----MaskedTextField
                                   |
                                   +----com.symantec.itools.awt.DateMaskedField

public class DateMaskedField
extends MaskedTextField
implements Serializable, DateMaskedFieldConstants
DateMaskedField is a masked text component that automatically assumes a mask based on the current locale and the type and formatting style specified by the user.

Version:
1.0
Author:
Vasudev J. Rao
See Also:
MaskedTextField

Variable Index

 o formattingStyle
 o includeLiterals
 o type
 o xlator

Constructor Index

 o com.symantec.itools.awt.DateMaskedField()
Default contsructor.
 o com.symantec.itools.awt.DateMaskedField(int, int)
Constructs a masked field with the specified date type and style.

Method Index

 o getDateMask()
Returns the current mask.
 o getFormatter(int, int)
Get a date/time formatter for the given type and formatting style.
 o getFormatterLocalizedPattern(DateFormat)
Get the localized date pattern string for a DateFormat.
 o getFormatterPattern(DateFormat)
Get the date pattern string for a DateFormat.
 o getFormattingStyle()
Returns the style of date, time or timestamp.
 o getMaskForDateFormat(DateFormat)
Get the mask representation of a DateFormat.
 o getMatchedText(String)
 o getPattern()
Get the date/time formatter pattern for the current type and formatting style.
 o getType()
Returns the type of date.
 o getUnmaskedText()
 o isIncludeLiterals()
Returns whether or not literals would be included in the masked and Unmasked texts.
 o parseDateValue(String)
Parse a string to a date using the current type.
 o parseDateValue(String, int)
Parse a string to a date using the given type.
 o setFormattingStyle(int)
Set the style of the date, time or timestamp.
 o setIncludeLiterals(boolean)
If set to true, the method setMaskedText would expect the dates to have separators and all other literals.
 o setMaskedText(String)
Initialize the field
 o setType(int)
Set the type of date.

Variables

 o formattingStyle
protected int formattingStyle
 o includeLiterals
protected boolean includeLiterals
 o type
protected int type
 o xlator
protected com.symantec.itools.swing.DatePatternToMaskXLator xlator

Constructors

 o DateMaskedField
public DateMaskedField()
Default contsructor. Constructs a date masked field of LONG style.

 o DateMaskedField
public DateMaskedField(int type,
                       int style)
Constructs a masked field with the specified date type and style. Type can be one of DATE_TYPE, TIME_TYPE or TIMESTAMP_TYPE. Style can be one of DateFormat.DEFAULT, FULL, LONG, MEDIUM or SHORT.

Methods

 o getDateMask
public java.lang.String getDateMask()
Returns the current mask.

 o getFormatter
protected java.text.DateFormat getFormatter(int type,
                                            int style)
Get a date/time formatter for the given type and formatting style.

 o getFormatterLocalizedPattern
protected java.lang.String getFormatterLocalizedPattern(DateFormat dateFormat)
Get the localized date pattern string for a DateFormat.

 o getFormatterPattern
protected java.lang.String getFormatterPattern(DateFormat dateFormat)
Get the date pattern string for a DateFormat.

 o getFormattingStyle
public int getFormattingStyle()
Returns the style of date, time or timestamp. Would be one of DateFormat.DEFAULT, FULL, LONG, MEDIUM or SHORT.

 o getMaskForDateFormat
protected java.lang.String getMaskForDateFormat(DateFormat dateFormat)
Get the mask representation of a DateFormat.

 o getMatchedText
protected java.lang.String getMatchedText(String s)
Overrides:
getMatchedText in class MaskedTextField
 o getPattern
public java.lang.String getPattern()
Get the date/time formatter pattern for the current type and formatting style.

 o getType
public int getType()
Returns the type of date. Would be one of DATE_TYPE, TIME_TYPE or TIMESTAMP_TYPE.

 o getUnmaskedText
public synchronized java.lang.String getUnmaskedText()
Overrides:
getUnmaskedText in class MaskedTextField
 o isIncludeLiterals
public boolean isIncludeLiterals()
Returns whether or not literals would be included in the masked and Unmasked texts.

 o parseDateValue
protected java.util.Date parseDateValue(String s)
Parse a string to a date using the current type.

 o parseDateValue
protected java.util.Date parseDateValue(String s,
                                        int type)
Parse a string to a date using the given type.

 o setFormattingStyle
public void setFormattingStyle(int newStyle)
Set the style of the date, time or timestamp. Should be one of DateFormat.DEFAULT, FULL, LONG, MEDIUM or SHORT. If the type is invalid, DEFAULT is used.

 o setIncludeLiterals
public void setIncludeLiterals(boolean b)
If set to true, the method setMaskedText would expect the dates to have separators and all other literals. Also the method getUnmaskedText would return all the separators and literals. If false, the behavior would default to the behavior of MaskedTextField.

For eg., in case of SHORT date, when set to true, setMaskedText expects dates "10-Jun-1998" and when set to false it expects 10Jun1998. Similarly, getUnmaskedText would return "10-Jun-1998" or "10Jun1998" based on ths setting.

 o setMaskedText
public void setMaskedText(String s)
Initialize the field

Overrides:
setMaskedText in class MaskedTextField
 o setType
public void setType(int newType)
Set the type of date. Should be one of DATE_TYPE, TIME_TYPE or TIMESTAMP_TYPE. If the type supplied is invalid DATE_TYPE is used.


All Packages  Class Hierarchy  This Package  Previous  Next  Index