public void applyLocaleSettings( final LocaleSettings localeSettings ) { final SimpleDateFormat isoDateFormat = createSafely( localeSettings.getDatetimeFormatPattern(), DATETIME_FORMAT_DEFAULT, localeSettings.getLocale() ); final TimeZone timeZone = localeSettings.getTimeZone(); isoDateFormat.setTimeZone( timeZone ); setDefaultRenderer( Date.class, new FormattingTableCellRenderer( isoDateFormat ) ); setDefaultRenderer( Timestamp.class, new FormattingTableCellRenderer( isoDateFormat ) ); final DateCellEditor dateCellEditor = new DateCellEditor( Date.class ); dateCellEditor.setDateFormat( isoDateFormat ); setDefaultEditor( Date.class, dateCellEditor ); final DateCellEditor timestampEditor = new DateCellEditor( Timestamp.class ); timestampEditor.setDateFormat( isoDateFormat ); setDefaultEditor( Timestamp.class, timestampEditor ); final SimpleDateFormat dateFormat = createSafely( localeSettings.getDateFormatPattern(), DATE_FORMAT_DEFAULT, localeSettings.getLocale() ); dateFormat.setTimeZone( timeZone ); setDefaultRenderer( java.sql.Date.class, new FormattingTableCellRenderer( dateFormat ) ); final DateCellEditor sqlDateCellEditor = new DateCellEditor( java.sql.Date.class ); sqlDateCellEditor.setDateFormat( dateFormat ); setDefaultEditor( java.sql.Date.class, sqlDateCellEditor ); final SimpleDateFormat timeFormat = createSafely( localeSettings.getTimeFormatPattern(), TIME_FORMAT_DEFAULT, localeSettings.getLocale() ); timeFormat.setTimeZone( timeZone ); setDefaultRenderer( Time.class, new FormattingTableCellRenderer( timeFormat ) ); final TimeCellEditor timeCellEditor = new TimeCellEditor( Time.class ); timeCellEditor.setDateFormat( timeFormat ); setDefaultEditor( Time.class, timeCellEditor ); }
setDefaultRenderer( Date.class, new FormattingTableCellRenderer( isoDateFormat ) ); setDefaultRenderer( java.sql.Date.class, new FormattingTableCellRenderer ( new SimpleDateFormat( DATE_FORMAT_DEFAULT, Locale.ENGLISH ) ) ); setDefaultRenderer( Time.class, new FormattingTableCellRenderer ( new SimpleDateFormat( TIME_FORMAT_DEFAULT, Locale.ENGLISH ) ) ); setDefaultRenderer( Timestamp.class, new FormattingTableCellRenderer( isoDateFormat ) );