Changeset 7118 in josm
- Timestamp:
- 2014-05-13T13:39:24+02:00 (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/defaultpresets.xml
r7116 r7118 59 59 match: none/key/key!/keyvalue (default is "none", see below for more information) 60 60 length: length of input box (number of characters allowed) 61 alternative_autocomplete_keys: comma separated list of alternative keys to use for autocompletion 61 62 62 63 combo: combo box, with multiple choices and possible to enter free form text … … 6682 6683 <text key="addr:housenumber" text="House number" match="key" auto_increment="-2,-1,+1,+2" /> 6683 6684 <optional> 6684 <text key="addr:housename" text="House name" match="key" />6685 <text key="addr:street" text="Street name" use_last_as_default="force" match="key" />6685 <text key="addr:housename" text="House name" match="key" alternative_autocomplete_keys="name" /> 6686 <text key="addr:street" text="Street name" use_last_as_default="force" match="key" alternative_autocomplete_keys="name" /> 6686 6687 <text key="addr:city" text="City name" use_last_as_default="force" match="key" /> 6687 6688 <text key="addr:postcode" text="Post code" use_last_as_default="force" match="key" /> -
trunk/data/tagging-preset.xsd
r6824 r7118 157 157 <attribute name="match" type="tns:match" /> 158 158 <attribute name="length" type="positiveInteger" /> 159 <attribute name="alternative_autocomplete_keys" type="string" /> 159 160 160 161 <attribute name="type" use="prohibited" /> -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItem.java
r6795 r7118 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 4 import java.util.Arrays; 4 5 import java.util.Collection; 5 6 import java.util.List; … … 21 22 public abstract class TaggingPresetItem { 22 23 23 protected void initAutoCompletionField(AutoCompletingTextField field, String key) { 24 protected void initAutoCompletionField(AutoCompletingTextField field, String... key) { 25 initAutoCompletionField(field, Arrays.asList(key)); 26 } 27 28 protected void initAutoCompletionField(AutoCompletingTextField field, List<String> keys) { 24 29 if (Main.main == null) return; 25 30 OsmDataLayer layer = Main.main.getEditLayer(); … … 28 33 } 29 34 AutoCompletionList list = new AutoCompletionList(); 30 layer.data.getAutoCompletionManager().populateWithTagValues(list, key );35 layer.data.getAutoCompletionManager().populateWithTagValues(list, keys); 31 36 field.setAutoCompletionList(list); 32 37 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r7100 r7118 577 577 public String auto_increment; 578 578 public String length; 579 public String alternative_autocomplete_keys; 579 580 580 581 private JComponent value; … … 585 586 Usage usage = determineTextUsage(sel, key); 586 587 AutoCompletingTextField textField = new AutoCompletingTextField(); 587 initAutoCompletionField(textField, key); 588 if (alternative_autocomplete_keys != null) { 589 initAutoCompletionField(textField, (key + "," + alternative_autocomplete_keys).split(",")); 590 } else { 591 initAutoCompletionField(textField, key); 592 } 588 593 if (length != null && !length.isEmpty()) { 589 594 textField.setMaxChars(Integer.valueOf(length));
Note:
See TracChangeset
for help on using the changeset viewer.