source: josm/trunk/src/org/openstreetmap/josm/gui/history/VersionTableColumnModel.java@ 10254

Last change on this file since 10254 was 9983, checked in by Don-vip, 8 years ago

remove unused code

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.history;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import javax.swing.SwingConstants;
7import javax.swing.table.DefaultTableColumnModel;
8import javax.swing.table.TableColumn;
9import javax.swing.table.TableColumnModel;
10
11/**
12 * The {@link TableColumnModel} for the table with the list of versions
13 *
14 */
15public class VersionTableColumnModel extends DefaultTableColumnModel {
16
17 /** Column index for version */
18 public static final int COL_VERSION = 0;
19 /** Column index for reference */
20 public static final int COL_REFERENCE = 1;
21 /** Column index for current */
22 public static final int COL_CURRENT = 2;
23 /** Column index for date */
24 public static final int COL_DATE = 3;
25 /** Column index for user */
26 public static final int COL_USER = 4;
27
28 protected void createColumns() {
29 TableColumn col = null;
30 VersionTable.RadioButtonRenderer bRenderer = new VersionTable.RadioButtonRenderer();
31
32 // column 0 - Version
33 col = new TableColumn(COL_VERSION);
34 /* translation note: 3 letter abbr. for "Version" */
35 col.setHeaderValue(tr("Ver"));
36 col.setCellRenderer(new VersionTable.AlignedRenderer(SwingConstants.CENTER));
37 col.setResizable(false);
38 addColumn(col);
39 // column 1 - Reference
40 col = new TableColumn(COL_REFERENCE);
41 col.setHeaderValue(tr("A"));
42 col.setCellRenderer(bRenderer);
43 col.setCellEditor(new VersionTable.RadioButtonEditor());
44 col.setResizable(false);
45 addColumn(col);
46 // column 2 - Current
47 col = new TableColumn(COL_CURRENT);
48 col.setHeaderValue(tr("B"));
49 col.setCellRenderer(bRenderer);
50 col.setCellEditor(new VersionTable.RadioButtonEditor());
51 col.setResizable(false);
52 addColumn(col);
53 // column 3 - Date
54 col = new TableColumn(COL_DATE);
55 col.setHeaderValue(tr("Date"));
56 col.setResizable(false);
57 addColumn(col);
58 // column 4 - User
59 col = new TableColumn(COL_USER);
60 col.setHeaderValue(tr("User"));
61 col.setResizable(false);
62 addColumn(col);
63 }
64
65 /**
66 * Creates a new {@code VersionTableColumnModel}.
67 */
68 public VersionTableColumnModel() {
69 createColumns();
70 }
71}
Note: See TracBrowser for help on using the repository browser.