Package com.im.df.util.ui
Class DateFormatProvider
- java.lang.Object
-
- com.im.df.util.ui.DateFormatProvider
-
public final class DateFormatProvider extends Object
Class to provide date formatting for date widgets and date renderers. It is used to transfer properties of date renderer (e.g. custom date format) to date widget using DateFormatProperties interface. Also contains helper methods for custom date format recognition and creation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDateFormatProvider.DateFormatPropertiesInterface to transfer properties of date renderer.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DateFormatgetDateFormat(boolean dateTime)Returns the default date formatting object.static DateFormatgetDateFormat(com.im.df.api.ddl.DFField field)New default date format is constructed from a field.static DateFormatgetDateFormat(String dateFormatString, com.im.df.api.ddl.DFField field)New date format is constructed from either custom date format or a field.static DateFormatgetDateFormat(org.openide.util.Lookup.Provider renderer, com.im.df.api.ddl.DFField field)New date format is constructed from either renderer's custom date format or a field.static booleanisDefaultFormat(String dateFormat)Decides if string date format is custom date format or just a default.
-
-
-
Method Detail
-
isDefaultFormat
public static boolean isDefaultFormat(String dateFormat)
Decides if string date format is custom date format or just a default.- Parameters:
dateFormat- Default or custom date format (the pattern describing the date and time format)- Returns:
- On empty or 'Default' date format value returns
true.
-
getDateFormat
public static DateFormat getDateFormat(org.openide.util.Lookup.Provider renderer, com.im.df.api.ddl.DFField field)
New date format is constructed from either renderer's custom date format or a field.- Parameters:
renderer- Widget rendererfield- Field bound to widget or renderer- Returns:
- New
DateFormat
-
getDateFormat
public static DateFormat getDateFormat(String dateFormatString, com.im.df.api.ddl.DFField field)
New date format is constructed from either custom date format or a field.- Parameters:
dateFormatString- Default or custom date format (the pattern describing the date and time format)field- Field bound to widget or renderer- Returns:
- New
DateFormat
-
getDateFormat
public static DateFormat getDateFormat(com.im.df.api.ddl.DFField field)
New default date format is constructed from a field.- Parameters:
field- Field bound to widget or renderer- Returns:
- New
DateFormat
-
getDateFormat
public static DateFormat getDateFormat(boolean dateTime)
Returns the default date formatting object.- Parameters:
dateTime- Datetime flag -truefor date and time,falsefor date only- Returns:
- Default
DateFormat - See Also:
DataConvertorUtils.getDateFormat(boolean)
-
-