source: josm/trunk/src/org/openstreetmap/josm/corrector/RoleCorrectionTableModel.java@ 1613

Last change on this file since 1613 was 1001, checked in by stoecker, 16 years ago

fixed incomplete ckeckin

File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.corrector;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.util.List;
7
8import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
9
10public class RoleCorrectionTableModel extends
11 CorrectionTableModel<RoleCorrection> {
12
13 private static NameVisitor nameVisitor = new NameVisitor();
14
15 public RoleCorrectionTableModel(List<RoleCorrection> roleCorrections) {
16 super(roleCorrections);
17 }
18
19 @Override
20 public int getColumnCount() {
21 return 4;
22 }
23
24 @Override
25 public String getCorrectionColumnName(int colIndex) {
26 switch (colIndex) {
27 case 0:
28 return tr("Relation");
29 case 1:
30 return tr("Old role");
31 case 2:
32 return tr("New role");
33 }
34 return null;
35 }
36
37 @Override
38 public Object getCorrectionValueAt(int rowIndex, int colIndex) {
39 RoleCorrection roleCorrection = getCorrections().get(rowIndex);
40
41 switch (colIndex) {
42 case 0:
43 roleCorrection.relation.visit(nameVisitor);
44 return nameVisitor.name;
45 case 1:
46 return roleCorrection.member.role;
47 case 2:
48 return roleCorrection.newRole;
49 }
50 return null;
51 }
52
53 @Override
54 protected boolean isBoldCell(int row, int column) {
55 return column == 2;
56 }
57
58}
Note: See TracBrowser for help on using the repository browser.