1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.history;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import javax.swing.table.DefaultTableColumnModel;
|
---|
7 | import 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 | */
|
---|
13 | public 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 | }
|
---|