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

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

history browser: changed selection of 2 compared version. WAS: double click and single click. NOW: 2 rows of radio buttons (inspired by Mediawiki)

  • Property svn:eol-style set to native
File size: 1.4 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.TableCellRenderer;
8import javax.swing.table.TableColumn;
9/**
10 * The {@see TableColumnModel} for the table with the list of versions
11 *
12 */
13public class VersionTableColumnModel extends DefaultTableColumnModel {
14 protected void createColumns() {
15 TableColumn col = null;
16 TableCellRenderer renderer = new VersionTableCellRenderer();
17 VersionTable.RadioButtonRenderer bRenderer = new VersionTable.RadioButtonRenderer();
18
19 // column 0 - Reverence
20 col = new TableColumn(0);
21 col.setCellRenderer(bRenderer);
22 col.setCellEditor(new VersionTable.RadioButtonEditor());
23 col.setMaxWidth(1);
24 col.setResizable(false);
25 addColumn(col);
26 // column 1 - Current
27 col = new TableColumn(1);
28 col.setCellRenderer(bRenderer);
29 col.setCellEditor(new VersionTable.RadioButtonEditor());
30 col.setMaxWidth(1);
31 col.setResizable(false);
32 addColumn(col);
33 // column 2 - Rest
34 col = new TableColumn(2);
35 col.setHeaderValue(tr("Version"));
36 col.setCellRenderer(renderer);
37 addColumn(col);
38 }
39
40 public VersionTableColumnModel() {
41 createColumns();
42 }
43}
Note: See TracBrowser for help on using the repository browser.