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

Last change on this file since 7509 was 6084, checked in by bastiK, 11 years ago

see #8902 - add missing @Override annotations (patch by shinigami)

  • 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.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 @Override
35 public Object getCorrectionValueAt(int rowIndex, int colIndex) {
36 TagCorrection tagCorrection = getCorrections().get(rowIndex);
37
38 switch (colIndex) {
39 case 0:
40 return tagCorrection.oldKey;
41 case 1:
42 return tagCorrection.oldValue;
43 case 2:
44 return tagCorrection.newKey;
45 case 3:
46 return tagCorrection.newValue;
47 }
48 return null;
49 }
50
51 @Override
52 protected boolean isBoldCell(int row, int column) {
53 TagCorrection tagCorrection = getCorrections().get(row);
54 return (column == 2 && tagCorrection.isKeyChanged())
55 || (column == 3 && tagCorrection.isValueChanged());
56 }
57
58}
Note: See TracBrowser for help on using the repository browser.