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

Last change on this file since 12678 was 11322, checked in by Don-vip, 7 years ago

fix #14032 - include editor (retrieved from created_by changeset tag) in history dialog

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