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

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

see #7219 - CT-Column-Title in history window only displays ...

  • 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.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.setResizable(false);
33 addColumn(col);
34 // column 2 - Current
35 col = new TableColumn(2);
36 col.setHeaderValue(tr("B"));
37 col.setCellRenderer(bRenderer);
38 col.setCellEditor(new VersionTable.RadioButtonEditor());
39 col.setResizable(false);
40 addColumn(col);
41 // column 3 - CT state
42 col = new TableColumn(3);
43 /* translation note: short for "Contributor Terms" */
44 col.setHeaderValue(tr("CT"));
45 col.setCellRenderer(new VersionTable.LabelRenderer());
46 col.setPreferredWidth(22);
47 col.setResizable(false);
48 addColumn(col);
49 // column 4 - Date
50 col = new TableColumn(4);
51 col.setHeaderValue(tr("Date"));
52 col.setResizable(false);
53 addColumn(col);
54 // column 5 - User
55 col = new TableColumn(5);
56 col.setHeaderValue(tr("User"));
57 col.setResizable(false);
58 addColumn(col);
59 }
60
61 public VersionTableColumnModel() {
62 createColumns();
63 }
64}
Note: See TracBrowser for help on using the repository browser.