Class 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.
    • 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 renderer
        field - 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 - true for date and time, false for date only
        Returns:
        Default DateFormat
        See Also:
        DataConvertorUtils.getDateFormat(boolean)