try
{
final SimpleDateFormat isoDateFormat =
new SimpleDateFormat(localeSettings.getDatetimeFormatPattern(), localeSettings.getLocale());
isoDateFormat.setTimeZone(localeSettings.getTimeZone());
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);
}
catch (Exception e)
{
logger.warn("Invalid format string found in locale settings", e);
}
try
{
final SimpleDateFormat dateFormat =
new SimpleDateFormat(localeSettings.getDateFormatPattern(), localeSettings.getLocale());
dateFormat.setTimeZone(localeSettings.getTimeZone());
setDefaultRenderer(java.sql.Date.class, new FormattingTableCellRenderer(dateFormat));
final DateCellEditor dateCellEditor = new DateCellEditor(java.sql.Date.class);
dateCellEditor.setDateFormat(dateFormat);
setDefaultEditor(java.sql.Date.class, dateCellEditor);
}
catch (Exception e)
{
logger.warn("Invalid format string found in locale settings", e);
}
try
{
final SimpleDateFormat timeFormat =
new SimpleDateFormat(localeSettings.getTimeFormatPattern(), localeSettings.getLocale());
timeFormat.setTimeZone(localeSettings.getTimeZone());
setDefaultRenderer(Time.class, new FormattingTableCellRenderer(timeFormat));
final TimeCellEditor timeCellEditor = new TimeCellEditor(Time.class);
timeCellEditor.setDateFormat(timeFormat);
setDefaultEditor(Time.class, timeCellEditor);
}