Ignore:
Timestamp:
2012-04-01T19:48:01+02:00 (12 years ago)
Author:
simon04
Message:

fix #5933 - tagging presets: allow to change the matching process (match=none|key|key!|keyvalue), remove delete_if_empty, default defaults to "", adapted comments in defaultpresets.xml, refactoring of the matching process (removes some duplicate code and some magical arithmetic)

File:
1 edited

Legend:

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

    r4191 r5155  
    66import java.awt.GridBagLayout;
    77import java.awt.Insets;
    8 import java.util.HashMap;
    9 import java.util.Map;
    10 import java.util.Map.Entry;
     8import java.util.EnumSet;
    119
    1210import javax.swing.BoxLayout;
     
    181179
    182180    private void updatePresets() {
    183         Map<String, Map<String, Integer>> valuesCount = new HashMap<String, Map<String,Integer>>();
    184         for (Entry<String, String> entry: model.getTags().entrySet()) {
    185             Map<String, Integer> values = new HashMap<String, Integer>();
    186             values.put(entry.getValue(), 1);
    187             valuesCount.put(entry.getKey(), values);
    188         }
    189         presetListPanel.updatePresets(0, 0, 1, 0, valuesCount, presetHandler);
     181        presetListPanel.updatePresets(
     182                EnumSet.of(TaggingPreset.PresetType.RELATION),
     183                model.getTags(), presetHandler);
    190184        validate();
    191185    }
Note: See TracChangeset for help on using the changeset viewer.