01: package net.sourceforge.squirrel_sql.fw.datasetviewer;
02:
03: import net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.RestorableJTextField;
04: import net.sourceforge.squirrel_sql.fw.util.StringManager;
05: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
06:
07: import javax.swing.*;
08: import javax.swing.plaf.ColorUIResource;
09: import javax.swing.table.DefaultTableCellRenderer;
10: import javax.swing.table.TableColumn;
11: import java.awt.*;
12:
13: public class RowNumberTableColumn extends TableColumn {
14: private static final StringManager s_stringMgr = StringManagerFactory
15: .getStringManager(RowNumberTableColumn.class);
16:
17: public static final int ROW_NUMBER_MODEL_INDEX = -42;
18:
19: // i18n[RowNumberTableColumn.rowNumber=Row Number]
20: public static final String ROW_NUMBER_HEADER = s_stringMgr
21: .getString("RowNumberTableColumn.rowNumber");
22:
23: public static final Object ROW_NUMBER_COL_IDENTIFIER = new Object();
24:
25: public RowNumberTableColumn() {
26: super (ROW_NUMBER_MODEL_INDEX, 100);
27:
28: DefaultTableCellRenderer rend = new DefaultTableCellRenderer();
29: rend.setBackground(Color.lightGray);
30:
31: setCellRenderer(rend);
32:
33: setCellEditor(new DefaultCellEditor(new RestorableJTextField()));
34: setHeaderValue(ROW_NUMBER_HEADER);
35:
36: setIdentifier(ROW_NUMBER_COL_IDENTIFIER);
37: }
38:
39: }
|