Changeset 6425 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-11-29T20:46:07+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6340 r6425 865 865 public String delimiter = ";"; 866 866 public String use_last_as_default = "false"; 867 /** whether to use values for search via {@link TaggingPresetSelector} */ 868 public String values_searchable = "false"; 867 869 868 870 protected JComponent component; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java
r6078 r6425 123 123 TaggingPreset group = preset.group; 124 124 while (group != null) { 125 for (String word: group.getLocaleName().toLowerCase().split("\\s")) { 126 groups.add(word); 127 } 125 Collections.addAll(groups, group.getLocaleName().toLowerCase().split("\\s")); 128 126 group = group.group; 129 127 } 130 for (String word: preset.getLocaleName().toLowerCase().split("\\s")) { 131 names.add(word); 132 } 128 Collections.addAll(names, preset.getLocaleName().toLowerCase().split("\\s")); 133 129 for (TaggingPresetItem item: preset.data) { 134 130 if (item instanceof KeyedItem) { 135 131 tags.add(((KeyedItem) item).key); 136 // Should combo values also be added? 132 if (item instanceof TaggingPresetItems.ComboMultiSelect) { 133 final TaggingPresetItems.ComboMultiSelect cms = (TaggingPresetItems.ComboMultiSelect) item; 134 if (Boolean.parseBoolean(cms.values_searchable)) { 135 tags.addAll(cms.getDisplayValues()); 136 } 137 } 137 138 if (item instanceof Key && ((Key) item).value != null) { 138 139 tags.add(((Key) item).value); … … 152 153 boolean foundFirst = false; 153 154 for (String value: values) { 154 int index = value. indexOf(word);155 int index = value.toLowerCase().indexOf(word); 155 156 if (index == 0) { 156 157 foundFirst = true;
Note:
See TracChangeset
for help on using the changeset viewer.