- java.lang.Object
-
- javafx.util.StringConverter<Date>
-
- javafx.util.converter.DateTimeStringConverter
-
- Direct Known Subclasses:
DateStringConverter,TimeStringConverter
public class DateTimeStringConverter extends StringConverter<Date>
StringConverterimplementation forDatevalues that represent a date and time.- Since:
- JavaFX 2.1
- See Also:
DateStringConverter,TimeStringConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected DateFormatdateFormatprotected intdateStyleprotected Localelocaleprotected Stringpatternprotected inttimeStyle
-
Constructor Summary
Constructors Constructor Description DateTimeStringConverter()DateTimeStringConverter(int dateStyle, int timeStyle)DateTimeStringConverter(String pattern)Create aStringConverterforDatevalues, using the specified pattern.DateTimeStringConverter(DateFormat dateFormat)DateTimeStringConverter(Locale locale)Create aStringConverterforDatevalues, using the specified locale andDateFormat.DEFAULTstyles for date and time.DateTimeStringConverter(Locale locale, int dateStyle, int timeStyle)Create aStringConverterforDatevalues, using specified locale andDateFormatstyles for date and time.DateTimeStringConverter(Locale locale, String pattern)Create aStringConverterforDatevalues, using the specified locale and pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DateFormatgetDateFormat()Return aDateFormatinstance to use for formatting and parsing in thisStringConverter.-
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods declared in class javafx.util.StringConverter
fromString, toString
-
-
-
-
Field Detail
-
locale
protected final Locale locale
-
pattern
protected final String pattern
-
dateFormat
protected final DateFormat dateFormat
-
dateStyle
protected final int dateStyle
- Since:
- JavaFX 8u40
-
timeStyle
protected final int timeStyle
- Since:
- JavaFX 8u40
-
-
Constructor Detail
-
DateTimeStringConverter
public DateTimeStringConverter()
-
DateTimeStringConverter
public DateTimeStringConverter(int dateStyle, int timeStyle)- Parameters:
dateStyle- the given formatting style. For example,DateFormat.SHORTfor "M/d/yy" in the US locale.timeStyle- the given formatting style. For example,DateFormat.SHORTfor "h:mm a" in the US locale.- Since:
- JavaFX 8u40
-
DateTimeStringConverter
public DateTimeStringConverter(Locale locale)
Create aStringConverterforDatevalues, using the specified locale andDateFormat.DEFAULTstyles for date and time.- Parameters:
locale- the given locale.
-
DateTimeStringConverter
public DateTimeStringConverter(Locale locale, int dateStyle, int timeStyle)
Create aStringConverterforDatevalues, using specified locale andDateFormatstyles for date and time.- Parameters:
locale- the given locale.dateStyle- the given formatting style. For example,DateFormat.SHORTfor "M/d/yy" in the US locale.timeStyle- the given formatting style. For example,DateFormat.SHORTfor "h:mm a" in the US locale.- Since:
- JavaFX 8u40
-
DateTimeStringConverter
public DateTimeStringConverter(String pattern)
Create aStringConverterforDatevalues, using the specified pattern.- Parameters:
pattern- the pattern describing the date and time format.
-
DateTimeStringConverter
public DateTimeStringConverter(Locale locale, String pattern)
Create aStringConverterforDatevalues, using the specified locale and pattern.- Parameters:
locale- the given locale.pattern- the pattern describing the date and time format.
-
DateTimeStringConverter
public DateTimeStringConverter(DateFormat dateFormat)
- Parameters:
dateFormat- theDateFormatto be used for formatting and parsing.
-
-
Method Detail
-
getDateFormat
protected DateFormat getDateFormat()
Return a
DateFormatinstance to use for formatting and parsing in thisStringConverter.- Returns:
- a
DateFormatinstance for formatting and parsing in thisStringConverter
-
-