Changeset 3250 in josm for trunk/src/org


Ignore:
Timestamp:
2010-05-15T14:40:08+02:00 (14 years ago)
Author:
stoecker
Message:

expose some preset functions a bit more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r3210 r3250  
    636636    }
    637637
    638     public static Collection<TaggingPreset> readFromPreferences() {
     638    public static Collection<TaggingPreset> readAll(Collection<String> sources) {
    639639        LinkedList<TaggingPreset> allPresets = new LinkedList<TaggingPreset>();
    640         LinkedList<String> sources = new LinkedList<String>();
    641 
    642         if(Main.pref.getBoolean("taggingpreset.enable-defaults", true)) {
    643             sources.add("resource://data/defaultpresets.xml");
    644         }
    645         sources.addAll(Main.pref.getCollection("taggingpreset.sources", new LinkedList<String>()));
    646 
    647640        for(String source : sources)
    648641        {
     
    685678    }
    686679
     680    public static LinkedList<String> getPresetSources() {
     681        LinkedList<String> sources = new LinkedList<String>();
     682
     683        if(Main.pref.getBoolean("taggingpreset.enable-defaults", true)) {
     684            sources.add("resource://data/defaultpresets.xml");
     685        }
     686        sources.addAll(Main.pref.getCollection("taggingpreset.sources", new LinkedList<String>()));
     687        return sources;
     688    }
     689
     690    public static Collection<TaggingPreset> readFromPreferences() {
     691        return readAll(getPresetSources());
     692    }
     693
    687694    private static class PresetPanel extends JPanel {
    688695        boolean hasElements = false;
Note: See TracChangeset for help on using the changeset viewer.