Ignore:
Timestamp:
2019-07-06T22:15:55+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #13458 - display external resources icons in the preferences

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/preferences/sources/ValidatorPrefHelper.java

    r14828 r15211  
    66import java.util.ArrayList;
    77import java.util.Collection;
    8 import java.util.HashMap;
    98import java.util.List;
    109import java.util.Map;
     
    1211import org.openstreetmap.josm.data.preferences.BooleanProperty;
    1312import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
     13import org.openstreetmap.josm.tools.ImageProvider;
    1414
    1515/**
     
    8686        ExtendedSourceEntry i = new ExtendedSourceEntry(type, filename+".mapcss", "resource://data/validator/"+filename+".mapcss");
    8787        i.title = title;
     88        i.icon = new ImageProvider("logo").getResource();
    8889        i.description = description;
    8990        defaults.add(i);
     
    9293    @Override
    9394    public Map<String, String> serialize(SourceEntry entry) {
    94         Map<String, String> res = new HashMap<>();
    95         res.put("url", entry.url);
    96         res.put("title", entry.title == null ? "" : entry.title);
     95        Map<String, String> res = super.serialize(entry);
    9796        res.put("active", Boolean.toString(entry.active));
    9897        return res;
    9998    }
    100 
    101     @Override
    102     public SourceEntry deserialize(Map<String, String> s) {
    103         return new SourceEntry(type, s.get("url"), null, s.get("title"), Boolean.parseBoolean(s.get("active")));
    104     }
    10599}
Note: See TracChangeset for help on using the changeset viewer.