source: josm/trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableColumnModel.java@ 8005

Last change on this file since 8005 was 7556, checked in by Don-vip, 10 years ago

fix #8262 - Relation editor: filter autocompletion of roles by relation type

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.dialogs.relation;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import javax.swing.table.DefaultTableColumnModel;
7import javax.swing.table.TableColumn;
8
9import org.openstreetmap.josm.data.osm.DataSet;
10import org.openstreetmap.josm.data.osm.Relation;
11
12public class MemberTableColumnModel extends DefaultTableColumnModel {
13
14 /**
15 * Constructs a new {@code MemberTableColumnModel}.
16 * @param ds the data set. Must not be null
17 * @param relation the relation. Can be null
18 */
19 public MemberTableColumnModel(DataSet ds, Relation relation) {
20 TableColumn col = null;
21
22 // column 0 - the member role
23 col = new TableColumn(0);
24 col.setHeaderValue(tr("Role"));
25 col.setResizable(true);
26 col.setPreferredWidth(100);
27 col.setCellRenderer(new MemberTableRoleCellRenderer());
28 col.setCellEditor(new MemberRoleCellEditor(ds, relation));
29 addColumn(col);
30
31 // column 1 - the member
32 col = new TableColumn(1);
33 col.setHeaderValue(tr("Refers to"));
34 col.setResizable(true);
35 col.setPreferredWidth(300);
36 col.setCellRenderer(new MemberTableMemberCellRenderer());
37 addColumn(col);
38
39 // column 2 -
40 col = new TableColumn(2);
41 col.setHeaderValue("");
42 col.setResizable(false);
43 col.setPreferredWidth(20);
44 col.setCellRenderer(new MemberTableLinkedCellRenderer());
45 addColumn(col);
46 }
47}
Note: See TracBrowser for help on using the repository browser.