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

Last change on this file since 6792 was 5622, checked in by jttt, 11 years ago

Compare selected version with previous after click on date on user in history dialog

  • Property svn:eol-style set to native
File size: 2.1 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 public static final int COL_VERSION = 0;
18 public static final int COL_REFERENCE = 1;
19 public static final int COL_CURRENT = 2;
20 public static final int COL_DATE = 3;
21 public static final int COL_USER = 4;
22
23 protected void createColumns() {
24 TableColumn col = null;
25 VersionTable.RadioButtonRenderer bRenderer = new VersionTable.RadioButtonRenderer();
26
27 // column 0 - Version
28 col = new TableColumn(0);
29 /* translation note: 3 letter abbr. for "Version" */
30 col.setHeaderValue(tr("Ver"));
31 col.setCellRenderer(new VersionTable.AlignedRenderer(SwingConstants.CENTER));
32 col.setResizable(false);
33 addColumn(col);
34 // column 1 - Reference
35 col = new TableColumn(1);
36 col.setHeaderValue(tr("A"));
37 col.setCellRenderer(bRenderer);
38 col.setCellEditor(new VersionTable.RadioButtonEditor());
39 col.setResizable(false);
40 addColumn(col);
41 // column 2 - Current
42 col = new TableColumn(2);
43 col.setHeaderValue(tr("B"));
44 col.setCellRenderer(bRenderer);
45 col.setCellEditor(new VersionTable.RadioButtonEditor());
46 col.setResizable(false);
47 addColumn(col);
48 // column 3 - Date
49 col = new TableColumn(3);
50 col.setHeaderValue(tr("Date"));
51 col.setResizable(false);
52 addColumn(col);
53 // column 4 - User
54 col = new TableColumn(4);
55 col.setHeaderValue(tr("User"));
56 col.setResizable(false);
57 addColumn(col);
58 }
59
60 /**
61 * Creates a new {@code VersionTableColumnModel}.
62 */
63 public VersionTableColumnModel() {
64 createColumns();
65 }
66}
Note: See TracBrowser for help on using the repository browser.