Rev | Line | |
---|
[729] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.corrector;
|
---|
| 3 |
|
---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
| 5 |
|
---|
| 6 | import java.util.List;
|
---|
| 7 |
|
---|
[1000] | 8 | public class TagCorrectionTableModel extends CorrectionTableModel<TagCorrection> {
|
---|
[729] | 9 |
|
---|
[1169] | 10 | public TagCorrectionTableModel(List<TagCorrection> tagCorrections) {
|
---|
| 11 | super(tagCorrections);
|
---|
| 12 | }
|
---|
[729] | 13 |
|
---|
[1169] | 14 | @Override
|
---|
| 15 | public int getColumnCount() {
|
---|
| 16 | return 5;
|
---|
| 17 | }
|
---|
[729] | 18 |
|
---|
[1169] | 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 | }
|
---|
[729] | 33 |
|
---|
[1000] | 34 | public Object getCorrectionValueAt(int rowIndex, int colIndex) {
|
---|
[1169] | 35 | TagCorrection tagCorrection = getCorrections().get(rowIndex);
|
---|
[729] | 36 |
|
---|
[1169] | 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 | }
|
---|
[729] | 49 |
|
---|
[1169] | 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 | }
|
---|
[729] | 55 |
|
---|
| 56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.