Ignore:
Timestamp:
2015-12-26T22:15:37+01:00 (9 years ago)
Author:
simon04
Message:

JOSM/wikipedia: Demystify also *:wikidata tags - see #josm9775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikidataTagCellRenderer.java

    r31858 r31866  
    4141    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    4242        if (column != 1
    43                 || !(value instanceof Map<?, ?> && ((Map<?, ?>) value).size() == 1)
    44                 || !"wikidata".equals(table.getValueAt(row, 0).toString())) {
     43                || !(value instanceof Map<?, ?> && ((Map<?, ?>) value).size() == 1)) {
    4544            return null;
    4645        }
     46        final String key = table.getValueAt(row, 0).toString();
     47        if (!("wikidata".equals(key) || key != null && key.endsWith(":wikidata"))) {
     48            return null;
     49        }
     50
    4751        final String id = ((Map<?, ?>) value).keySet().iterator().next().toString();
    4852        if (!WikipediaApp.WIKIDATA_PATTERN.matcher(id).matches()) {
Note: See TracChangeset for help on using the changeset viewer.