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

Last change on this file since 4601 was 4601, checked in by bastiK, 12 years ago

history panel: new column indicating CT status of the user

  • Property svn:eol-style set to native
File size: 2.2 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.TableCellRenderer;
9import javax.swing.table.TableColumn;
10
11/**
12 * The {@see TableColumnModel} for the table with the list of versions
13 *
14 */
15public class VersionTableColumnModel extends DefaultTableColumnModel {
16 protected void createColumns() {
17 TableColumn col = null;
18 VersionTable.RadioButtonRenderer bRenderer = new VersionTable.RadioButtonRenderer();
19
20 // column 0 - Version
21 col = new TableColumn(0);
22 /* translation note: 3 letter abbr. for "Version" */
23 col.setHeaderValue(tr("Ver"));
24 col.setCellRenderer(new VersionTable.AlignedRenderer(SwingConstants.CENTER));
25 col.setResizable(false);
26 addColumn(col);
27 // column 1 - Reverence
28 col = new TableColumn(1);
29 col.setHeaderValue(tr("A"));
30 col.setCellRenderer(bRenderer);
31 col.setCellEditor(new VersionTable.RadioButtonEditor());
32 col.setMaxWidth(18);
33 col.setResizable(false);
34 addColumn(col);
35 // column 2 - Current
36 col = new TableColumn(2);
37 col.setHeaderValue(tr("B"));
38 col.setCellRenderer(bRenderer);
39 col.setCellEditor(new VersionTable.RadioButtonEditor());
40 col.setPreferredWidth(18);
41 col.setResizable(false);
42 addColumn(col);
43 // column 3 - CT state
44 col = new TableColumn(3);
45 /* translation note: short for "Contributor Terms" */
46 col.setHeaderValue(tr("CT"));
47 col.setCellRenderer(new VersionTable.LabelRenderer());
48 col.setPreferredWidth(22);
49 col.setResizable(false);
50 addColumn(col);
51 // column 4 - Date
52 col = new TableColumn(4);
53 col.setHeaderValue(tr("Date"));
54 col.setResizable(false);
55 addColumn(col);
56 // column 5 - User
57 col = new TableColumn(5);
58 col.setHeaderValue(tr("User"));
59 col.setResizable(false);
60 addColumn(col);
61 }
62
63 public VersionTableColumnModel() {
64 createColumns();
65 }
66}
Note: See TracBrowser for help on using the repository browser.