Changeset 6425 in josm
- Timestamp:
- 2013-11-29T20:46:07+01:00 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/defaultpresets.xml
r6402 r6425 699 699 <label text="Transport mode restrictions" /> 700 700 <space /> 701 <combo key="access" text="General Access" values="yes,destination,delivery,permissive,private,customers,agricultural,forestry,no" match="key" />701 <combo key="access" text="General Access" values="yes,destination,delivery,permissive,private,customers,agricultural,forestry,no" match="key" values_searchable="true" /> 702 702 <combo key="foot" text="Foot" values="yes,official,designated,permissive,destination,delivery,private,no" match="key" /> 703 703 <combo key="horse" text="Horse" values="yes,official,designated,permissive,destination,delivery,private,no" match="key" /> … … 855 855 <combo key="incline" text="Incline" values="10%,-10%,10°,-10°,up,down" /> 856 856 <check key="lit" text="Lit" default="off" /> 857 <combo key="sac_scale" text="SAC Scale" >857 <combo key="sac_scale" text="SAC Scale" values_searchable="true"> 858 858 <list_entry value="hiking" display_value="T1 - hiking trail" short_description="Trail well cleared. Area flat or slightly sloped, no fall hazard" /> 859 859 <list_entry value="mountain_hiking" display_value="T2 - mountain hiking trail" short_description="Trail with continuous line and balanced ascent. Terrain partially steep, fall hazard possible" /> … … 1143 1143 <key key="highway" value="crossing" /> 1144 1144 <combo key="crossing" text="Pedestrian crossing type" values="uncontrolled,traffic_signals,island,unmarked,no,unknown" /> 1145 <combo key="crossing_ref" text="Crossing type name (UK)" values="zebra,pelican,toucan,puffin,pegasus,tiger" />1145 <combo key="crossing_ref" text="Crossing type name (UK)" values="zebra,pelican,toucan,puffin,pegasus,tiger" values_searchable="true" /> 1146 1146 <check key="supervised" text="Crossing attendant" default="off" /> 1147 1147 <check key="bicycle" text="Cross by bicycle" default="off" /> … … 1160 1160 <label text="Edit Traffic Calming" /> 1161 1161 <space /> 1162 <combo key="traffic_calming" text="Type" values="yes,bump,chicane,choker,cushion,hump,island,rumble_strip,table" match="key" />1162 <combo key="traffic_calming" text="Type" values="yes,bump,chicane,choker,cushion,hump,island,rumble_strip,table" match="key" values_searchable="true" /> 1163 1163 </item> 1164 1164 <item name="Passing Place" icon="presets/passingplace.png" type="node"> … … 1889 1889 <key key="natural" value="water" /> 1890 1890 <text key="name" text="Name" /> 1891 <combo key="water" text="Water Body" values="lake,lagoon,pond,reservoir" match="key" />1891 <combo key="water" text="Water Body" values="lake,lagoon,pond,reservoir" match="key" values_searchable="true" /> 1892 1892 </item> 1893 1893 <item name="Land" icon="presets/landuse.png" type="node,closedway,relation"> … … 1936 1936 <key key="natural" value="wetland" /> 1937 1937 <text key="name" text="Name" /> 1938 <combo key="wetland" text="Type" values="swamp,bog,marsh,reedbed,saltmarsh,tidalflat,mangrove" />1938 <combo key="wetland" text="Type" values="swamp,bog,marsh,reedbed,saltmarsh,tidalflat,mangrove" values_searchable="true" /> 1939 1939 </item> 1940 1940 <item name="Mud" icon="presets/mud.png" type="node,closedway,relation"> … … 2528 2528 <space /> 2529 2529 <key key="amenity" value="fuel" /> 2530 <combo key="brand" text="Brand" values="Agip,Aral,Avia,BP,Chevron,Citgo,Esso,Exxon,Gulf,Mobil,OMV,Petro-Canada,Pioneer,Q8,Repsol,Shell,Sunoco,Statoil,Tamoil,Texaco,Total,Independent" />2530 <combo key="brand" text="Brand" values="Agip,Aral,Avia,BP,Chevron,Citgo,Esso,Exxon,Gulf,Mobil,OMV,Petro-Canada,Pioneer,Q8,Repsol,Shell,Sunoco,Statoil,Tamoil,Texaco,Total,Independent" values_searchable="true" /> 2531 2531 <optional> 2532 2532 <text key="name" text="Name" /> … … 2765 2765 <space /> 2766 2766 <key key="type" value="route" /> 2767 <combo key="route" text="Route type" values="train,subway,monorail,tram,bus,trolleybus,aerialway,ferry" />2767 <combo key="route" text="Route type" values="train,subway,monorail,tram,bus,trolleybus,aerialway,ferry" values_searchable="true" /> 2768 2768 <text key="name" text="Name" /> 2769 2769 <text key="ref" text="Reference" /> … … 3347 3347 <text key="name" text="Name" /> 3348 3348 <text key="operator" text="Operator" /> 3349 <multiselect key="cuisine" text="Cuisine" values="italian;chinese;pizza;burger;greek;german;indian;regional;kebab;turkish;asian;thai;mexican;japanese;french;sandwich;sushi" />3349 <multiselect key="cuisine" text="Cuisine" values="italian;chinese;pizza;burger;greek;german;indian;regional;kebab;turkish;asian;thai;mexican;japanese;french;sandwich;sushi" values_searchable="true" /> 3350 3350 <check key="microbrewery" text="Microbrewery" default="off" /> 3351 3351 <combo key="opening_hours" text="Opening Hours" delimiter="|" values="24/7|08:30-12:30,15:30-20:00|Sa-Su 00:00-24:00|Mo-Fr 08:30-20:00; Sa,Su 08:00-15:00; PH off|Mo-Fr 08:30-20:00,Tu-Su 08:00-15:00; Sa 08:00-12:00|Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off|sunrise-sunset|Su 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" /> … … 3975 3975 <key key="amenity" value="place_of_worship" /> 3976 3976 <text key="name" text="Name" /> 3977 <combo key="building" text="Building type" values="cathedral,chapel,church,mosque,synagogue,temple" match="keyvalue" />3978 <combo key="religion" text="Religion" values="bahai,buddhist,christian,hindu,jain,jewish,muslim,sikh,spiritualist,taoist,unitarian,zoroastrian" match="key" />3979 <combo key="denomination" text="Denomination" values="anglican,baptist,catholic,evangelical,jehovahs_witness,lutheran,methodist,mormon,orthodox,pentecostal,presbyterian,protestant,quaker,roman_catholic,shia,sunni" match="key" />3977 <combo key="building" text="Building type" values="cathedral,chapel,church,mosque,synagogue,temple" match="keyvalue" values_searchable="true" /> 3978 <combo key="religion" text="Religion" values="bahai,buddhist,christian,hindu,jain,jewish,muslim,sikh,spiritualist,taoist,unitarian,zoroastrian" match="key" values_searchable="true" /> 3979 <combo key="denomination" text="Denomination" values="anglican,baptist,catholic,evangelical,jehovahs_witness,lutheran,methodist,mormon,orthodox,pentecostal,presbyterian,protestant,quaker,roman_catholic,shia,sunni" match="key" values_searchable="true" /> 3980 3980 <combo key="service_times" text="Service Times" delimiter="|" values="18:00|sunset,sunrise|Su 9:30,11:00|Sa,Su,PH 9:00|Sa 18:00; Su 10:45|Fr 08:00-18:00; Apr 10-15 off; Jun 07:00-20:00; Aug off; Dec 24 08:00-24:00|Sa 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" /> 3981 3981 <combo key="opening_hours" text="Opening Hours" delimiter="|" values="24/7|08:30-12:30,15:30-20:00|Sa-Su 00:00-24:00|Mo-Fr 08:30-20:00; Sa,Su 08:00-15:00; PH off|Mo-Fr 08:30-20:00,Tu-Su 08:00-15:00; Sa 08:00-12:00|Mo-Su 08:00-18:00; Apr 10-15 off; Jun 08:00-14:00; Aug off; Dec 25 off|sunrise-sunset|Su 10:00+|week 1-53/2 Fr 09:00-12:00; week 2-52/2 We 09:00-12:00" /> … … 4498 4498 <text key="name" text="Name" /> 4499 4499 <check key="fireplace" text="Fireplace" default="off" /> 4500 <combo key="shelter_type" text="Type of shelter" values="weather_shelter,public_transport,picnic_shelter,wildlife_hide" values_context="shelter" />4500 <combo key="shelter_type" text="Type of shelter" values="weather_shelter,public_transport,picnic_shelter,wildlife_hide" values_context="shelter" values_searchable="true" /> 4501 4501 </item> 4502 4502 <item name="Hunting Stand" icon="presets/hunting_stand.png" type="node"> … … 4729 4729 <key key="sport" value="swimming" /> 4730 4730 <text key="name" text="Name" /> 4731 <combo key="leisure" text="Type" values="sports_centre,stadium,swimming_pool,water_park" default="swimming_pool" />4731 <combo key="leisure" text="Type" values="sports_centre,stadium,swimming_pool,water_park" default="swimming_pool" values_searchable="true" /> 4732 4732 </item> 4733 4733 <item name="Skiing" icon="presets/skiing_downhill.png" type="node,way,closedway"> … … 4738 4738 <text key="name" text="Name" /> 4739 4739 <combo key="piste:type" text="Piste type" values="downhill,nordic,skitour,snow_park" /> 4740 <combo key="piste:difficulty" text="Difficulty" values="novice,easy,intermediate,advanced,expert,freeride" values_context="piste:difficulty" />4740 <combo key="piste:difficulty" text="Difficulty" values="novice,easy,intermediate,advanced,expert,freeride" values_context="piste:difficulty" values_searchable="true" /> 4741 4741 <combo key="piste:grooming" text="Grooming" values="classic,mogul,skating,classic;skating,scooter,backcountry" values_context="piste:grooming" /> 4742 4742 </item> … … 5013 5013 <label text="Edit Building" /> 5014 5014 <space /> 5015 <combo key="building" text="Building" values="yes,roof,garage,garages,industrial,school,hangar,commercial,farm,transportation,greenhouse,office,university,hospital,warehouse,retail,shed" values_context="building" default="yes" match="keyvalue" />5015 <combo key="building" text="Building" values="yes,roof,garage,garages,industrial,school,hangar,commercial,farm,transportation,greenhouse,office,university,hospital,warehouse,retail,shed" values_context="building" default="yes" match="keyvalue" values_searchable="true" /> 5016 5016 <text key="name" text="Name" /> 5017 5017 </item> … … 5028 5028 <label text="Edit Residential Building" /> 5029 5029 <space /> 5030 <combo key="building" text="Building" values="residential,apartments,house,hut,dormitory,terrace,detached,roof" default="residential" match="keyvalue" values_context="building" />5030 <combo key="building" text="Building" values="residential,apartments,house,hut,dormitory,terrace,detached,roof" default="residential" match="keyvalue" values_context="building" values_searchable="true" /> 5031 5031 <text key="name" text="Name" /> 5032 5032 </item> … … 5342 5342 <text key="ref" text="Reference" /> 5343 5343 <text key="start_date" text="Start date" /> 5344 <combo key="generator:source" text="Source" >5344 <combo key="generator:source" text="Source" values_searchable="true"> 5345 5345 <list_entry value="biofuel" icon="http://wiki.openstreetmap.org/w/images/6/6b/Bahnpirat-power_source-biofuel.svg" /> 5346 5346 <list_entry value="biogas" icon="http://wiki.openstreetmap.org/w/images/6/6b/Bahnpirat-power_source-biofuel.svg" /> … … 5361 5361 <list_entry value="wind" icon="http://wiki.openstreetmap.org/w/images/0/03/2020_stBN_powergensource_wind.svg" /> 5362 5362 </combo> 5363 <combo key="generator:method" text="Method" values_context="generator method" >5363 <combo key="generator:method" text="Method" values_context="generator method" values_searchable="true"> 5364 5364 <list_entry value="anaerobic_digestion" short_description="" /> <!-- Recheck --> 5365 5365 <list_entry value="barrage" short_description="tidal" /> … … 5376 5376 <list_entry value="water-storage" short_description="hydro" /> 5377 5377 </combo> 5378 <combo key="generator:type" text="Generator Type" >5378 <combo key="generator:type" text="Generator Type" values_searchable="true"> 5379 5379 <list_entry value="combined_cycle" short_description="gas combustion" /> 5380 5380 <list_entry value="francis_turbine" short_description="hydro" /> … … 6345 6345 <space /> 6346 6346 <key key="amenity" value="vending_machine" /> 6347 <multiselect key="vending" text="Vending products" values="animal_food;bicycle_tube;cigarettes;condoms;drinks;excrement_bags;food;news_papers;parking_tickets;photos;public_transport_plans;public_transport_tickets;SIM-cards;stamps;sweets;tampons;telephone_vouchers;toys;vouchers" />6347 <multiselect key="vending" text="Vending products" values="animal_food;bicycle_tube;cigarettes;condoms;drinks;excrement_bags;food;news_papers;parking_tickets;photos;public_transport_plans;public_transport_tickets;SIM-cards;stamps;sweets;tampons;telephone_vouchers;toys;vouchers" values_searchable="true" /> 6348 6348 <text key="operator" text="Operator" /> 6349 6349 <text key="ref" text="Reference number" /> … … 7051 7051 <text key="name" text="Name" /> 7052 7052 <optional> 7053 <combo key="boundary" text="Boundary type" values="administrative,national,civil,political" />7053 <combo key="boundary" text="Boundary type" values="administrative,national,civil,political" values_searchable="true" /> 7054 7054 <combo key="admin_level" text="Administrative level" values="1,2,3,4,5,6,7,8,9,10" /> 7055 7055 </optional> … … 7089 7089 <space /> 7090 7090 <key key="type" value="restriction" /> 7091 <combo key="restriction" text="Restriction" values="no_left_turn,no_right_turn,no_straight_on,no_u_turn,only_right_turn,only_left_turn,only_straight_on" />7091 <combo key="restriction" text="Restriction" values="no_left_turn,no_right_turn,no_straight_on,no_u_turn,only_right_turn,only_left_turn,only_straight_on" values_searchable="true" /> 7092 7092 <optional> 7093 7093 <text key="name" text="Name" /> … … 7133 7133 <space /> 7134 7134 <key key="type" value="route" /> 7135 <combo key="route" text="Route type" values="bicycle,bus,road,ferry,ski,foot,hiking,tram,detour,railway,subway" values_context="route type" />7135 <combo key="route" text="Route type" values="bicycle,bus,road,ferry,ski,foot,hiking,tram,detour,railway,subway" values_context="route type" values_searchable="true" /> 7136 7136 <text key="name" text="Name" /> 7137 7137 <text key="ref" text="Reference" /> … … 7231 7231 <space /> 7232 7232 <key key="type" value="waterway" /> 7233 <combo key="waterway" text="Subtype of waterway (largest one of members)" values="river,stream,canal,drain,ditch" />7233 <combo key="waterway" text="Subtype of waterway (largest one of members)" values="river,stream,canal,drain,ditch" values_searchable="true" /> 7234 7234 <text key="name" text="Name" /> 7235 7235 <optional> -
trunk/data/tagging-preset.xsd
r6308 r6425 9 9 10 10 <element name="annotations" type="tns:root" /> 11 <element name="presets" type="tns:root" /> 11 <element name="presets" type="tns:root"> 12 <unique name="chunk_id"> 13 <selector xpath=".//tns:chunk"/> 14 <field xpath="@id"/> 15 </unique> 16 <keyref name="chunk_ref" refer="tns:chunk_id"> 17 <selector xpath=".//tns:reference"/> 18 <field xpath="@ref"/> 19 </keyref> 20 </element> 12 21 13 22 <complexType name="root"> … … 28 37 <sequence> 29 38 <choice minOccurs="1" maxOccurs="unbounded"> 39 <element name="chunk" type="tns:chunk"/> 30 40 <element name="group" type="tns:group" /> 31 41 <element name="item" type="tns:item" /> … … 74 84 <attribute name="text_context" type="string" /> 75 85 </complexType> 86 87 <complexType name="chunk"> 88 <sequence> 89 <choice minOccurs="1" maxOccurs="unbounded"> 90 <group ref="tns:optional_elements" /> 91 <element name="key" type="tns:key" /> 92 <element name="optional" type="tns:optional" minOccurs="0" /> 93 </choice> 94 </sequence> 95 <attribute name="id" type="ID" use="required" /> 96 </complexType> 97 98 <complexType name="reference"> 99 <attribute name="ref" type="IDREF" use="required" /> 100 </complexType> 76 101 77 102 <group name="optional_elements"> … … 86 111 <element name="check" type="tns:check" /> 87 112 <element name="item_separator" type="tns:separator" /> 113 <element name="reference" type="tns:reference" /> 88 114 </choice> 89 115 </group> … … 154 180 <attribute name="values_context" type="string" /> 155 181 <attribute name="display_values" type="string" /> 182 <attribute name="values_searchable" type="boolean" /> 156 183 <attribute name="default" type="string" /> 157 184 <attribute name="use_last_as_default" type="tns:last_default" /> … … 181 208 <attribute name="values_context" type="string" /> 182 209 <attribute name="display_values" type="string" /> 210 <attribute name="values_searchable" type="boolean" /> 183 211 <attribute name="default" type="string" /> 184 212 <attribute name="use_last_as_default" type="tns:last_default" /> -
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.