source: josm/trunk/src/org/openstreetmap/josm/gui/history/TagTableColumnModel.java@ 17921

Last change on this file since 17921 was 17887, checked in by simon04, 3 years ago

fix #20879 - History browser: which version changed a tag (git blame)?

  • Property svn:eol-style set to native
File size: 1.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.table.DefaultTableColumnModel;
7import javax.swing.table.TableColumn;
8
9/**
10 * The {@link javax.swing.table.TableColumnModel} for the table with the list of tags
11 * @since 1709
12 */
13public class TagTableColumnModel extends DefaultTableColumnModel {
14 protected static final int COLUMN_KEY = 0;
15 protected static final int COLUMN_VALUE = 1;
16 protected static final int COLUMN_VERSION = 2;
17
18 /**
19 * Constructs a new {@code TagTableColumnModel}.
20 */
21 public TagTableColumnModel() {
22 createColumns();
23 }
24
25 protected void createColumns() {
26 TagTableCellRenderer renderer = new TagTableCellRenderer();
27
28 TableColumn col = new TableColumn(COLUMN_KEY);
29 col.setHeaderValue(tr("Key"));
30 col.setCellRenderer(renderer);
31 col.setPreferredWidth(100);
32 addColumn(col);
33
34 col = new TableColumn(COLUMN_VALUE);
35 col.setHeaderValue(tr("Value"));
36 col.setCellRenderer(renderer);
37 col.setPreferredWidth(100);
38 addColumn(col);
39
40 col = new TableColumn(COLUMN_VERSION);
41 col.setHeaderValue(tr("Since"));
42 col.setCellRenderer(renderer);
43 col.setPreferredWidth(10);
44 addColumn(col);
45 }
46}
Note: See TracBrowser for help on using the repository browser.