001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.gui.conflict.tags;
003
004import static org.openstreetmap.josm.tools.I18n.tr;
005
006import javax.swing.table.DefaultTableColumnModel;
007import javax.swing.table.TableColumn;
008
009public class TagConflictResolverColumnModel extends DefaultTableColumnModel{
010
011    protected void createColumns() {
012        TableColumn col = null;
013        MultiValueCellRenderer renderer = new MultiValueCellRenderer();
014        MultiValueCellEditor editor = new MultiValueCellEditor();
015
016        // column 0 - State
017        col = new TableColumn(0);
018        col.setHeaderValue("");
019        col.setResizable(true);
020        col.setWidth(20);
021        col.setPreferredWidth(20);
022        col.setMaxWidth(30);
023        col.setCellRenderer(renderer);
024        addColumn(col);
025
026        // column 1 - Key
027        col = new TableColumn(1);
028        col.setHeaderValue(tr("Key"));
029        col.setResizable(true);
030        col.setCellRenderer(renderer);
031        addColumn(col);
032
033        // column 2 - Value
034        col = new TableColumn(2);
035        col.setHeaderValue(tr("Value"));
036        col.setResizable(true);
037        col.setCellRenderer(renderer);
038        col.setCellEditor(editor);
039        addColumn(col);
040    }
041
042    public TagConflictResolverColumnModel() {
043        createColumns();
044    }
045}