Ignore:
Timestamp:
2017-09-19T18:33:50+02:00 (7 years ago)
Author:
bastik
Message:

[indoorhelper] avoid usage of data.preferences.Setting class in anticipation of JOSM-core rework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/indoorhelper/src/controller/IndoorHelperController.java

    r32637 r33632  
    2424import java.awt.event.ItemListener;
    2525import java.util.ArrayList;
     26import java.util.Collection;
    2627import java.util.Collections;
    2728import java.util.HashMap;
     
    3435import org.openstreetmap.josm.actions.ValidateAction;
    3536import org.openstreetmap.josm.data.osm.Tag;
    36 import org.openstreetmap.josm.data.preferences.MapListSetting;
    37 import org.openstreetmap.josm.data.preferences.Setting;
    3837import org.openstreetmap.josm.data.validation.OsmValidator;
    3938import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
     
    395394     */
    396395    private void setPluginPreferences(boolean enabled) {
    397         Map<String, Setting<?>> settings = Main.pref.getAllSettings();
    398 
    399         MapListSetting validatorMapListSetting = (MapListSetting) settings.
    400                 get("validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries");
    401         List<Map<String, String>> validatorMaps = new ArrayList<>();
    402         if (validatorMapListSetting != null) {
    403             validatorMaps = validatorMapListSetting.getValue();
    404         }
    405 
    406         MapListSetting styleMapListSetting = (MapListSetting) settings.
    407                 get("mappaint.style.entries");
    408         List<Map<String, String>> styleMaps = new ArrayList<>();
    409         if (styleMapListSetting != null) {
    410             styleMaps = styleMapListSetting.getValue();
    411         }
     396        Collection<Map<String, String>> validatorMaps =
     397                Main.pref.getListOfStructs("validator.org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.entries",
     398                new ArrayList<>());
     399        Collection<Map<String, String>> styleMaps =
     400                Main.pref.getListOfStructs("mappaint.style.entries", new ArrayList<>());
    412401
    413402        if (enabled) {
Note: See TracChangeset for help on using the changeset viewer.