source: josm/trunk/src/org/openstreetmap/josm/corrector/TagCorrectionTableModel.java@ 2611

Last change on this file since 2611 was 1169, checked in by stoecker, 15 years ago

removed usage of tab stops

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
8public class TagCorrectionTableModel extends CorrectionTableModel<TagCorrection> {
9
10 public TagCorrectionTableModel(List<TagCorrection> tagCorrections) {
11 super(tagCorrections);
12 }
13
14 @Override
15 public int getColumnCount() {
16 return 5;
17 }
18
19 @Override
20 public String getCorrectionColumnName(int colIndex) {
21 switch (colIndex) {
22 case 0:
23 return tr("Old key");
24 case 1:
25 return tr("Old value");
26 case 2:
27 return tr("New key");
28 case 3:
29 return tr("New value");
30 }
31 return null;
32 }
33
34 public Object getCorrectionValueAt(int rowIndex, int colIndex) {
35 TagCorrection tagCorrection = getCorrections().get(rowIndex);
36
37 switch (colIndex) {
38 case 0:
39 return tagCorrection.oldKey;
40 case 1:
41 return tagCorrection.oldValue;
42 case 2:
43 return tagCorrection.newKey;
44 case 3:
45 return tagCorrection.newValue;
46 }
47 return null;
48 }
49
50 protected boolean isBoldCell(int row, int column) {
51 TagCorrection tagCorrection = getCorrections().get(row);
52 return (column == 2 && tagCorrection.isKeyChanged())
53 || (column == 3 && tagCorrection.isValueChanged());
54 }
55
56}
Note: See TracBrowser for help on using the repository browser.