01: /**
02: *
03: */package org.rapla.gui.toolkit;
04:
05: import java.awt.Component;
06: import java.util.Date;
07:
08: import javax.swing.JTable;
09: import javax.swing.table.DefaultTableCellRenderer;
10:
11: import org.rapla.framework.RaplaLocale;
12:
13: final public class DateCellRenderer extends DefaultTableCellRenderer {
14: private static final long serialVersionUID = 1L;
15:
16: RaplaLocale raplaLocale;
17:
18: public DateCellRenderer(RaplaLocale raplaLocale) {
19: this .raplaLocale = raplaLocale;
20: }
21:
22: public Component getTableCellRendererComponent(JTable table,
23: Object value, boolean isSelected, boolean hasFocus,
24: int row, int column) {
25: value = raplaLocale.formatDateLong((Date) value);
26: //setComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT );
27: return super.getTableCellRendererComponent(table, value,
28: isSelected, hasFocus, row, column);
29: }
30:
31: }
|