| Revision 3083,
1.3 KB
checked in by bastiK, 2 years ago
(diff) |
|
added svn:eol-style=native to source files
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 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 | |
|---|
| 8 | import org.openstreetmap.josm.gui.DefaultNameFormatter; |
|---|
| 9 | |
|---|
| 10 | public class RoleCorrectionTableModel extends |
|---|
| 11 | CorrectionTableModel<RoleCorrection> { |
|---|
| 12 | |
|---|
| 13 | public RoleCorrectionTableModel(List<RoleCorrection> roleCorrections) { |
|---|
| 14 | super(roleCorrections); |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | @Override |
|---|
| 18 | public int getColumnCount() { |
|---|
| 19 | return 4; |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | @Override |
|---|
| 23 | public String getCorrectionColumnName(int colIndex) { |
|---|
| 24 | switch (colIndex) { |
|---|
| 25 | case 0: |
|---|
| 26 | return tr("Relation"); |
|---|
| 27 | case 1: |
|---|
| 28 | return tr("Old role"); |
|---|
| 29 | case 2: |
|---|
| 30 | return tr("New role"); |
|---|
| 31 | } |
|---|
| 32 | return null; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | @Override |
|---|
| 36 | public Object getCorrectionValueAt(int rowIndex, int colIndex) { |
|---|
| 37 | RoleCorrection roleCorrection = getCorrections().get(rowIndex); |
|---|
| 38 | |
|---|
| 39 | switch (colIndex) { |
|---|
| 40 | case 0: |
|---|
| 41 | return roleCorrection.relation.getDisplayName(DefaultNameFormatter.getInstance()); |
|---|
| 42 | case 1: |
|---|
| 43 | return roleCorrection.member.getRole(); |
|---|
| 44 | case 2: |
|---|
| 45 | return roleCorrection.newRole; |
|---|
| 46 | } |
|---|
| 47 | return null; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | @Override |
|---|
| 51 | protected boolean isBoldCell(int row, int column) { |
|---|
| 52 | return column == 2; |
|---|
| 53 | } |
|---|
| 54 | |
|---|
| 55 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.