Changeset 16045 in josm
- Timestamp:
- 2020-03-06T00:23:37+01:00 (5 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/tagging/presets
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r15926 r16045 109 109 if (item instanceof ComboMultiSelect) { 110 110 final ComboMultiSelect cms = (ComboMultiSelect) item; 111 if ( Boolean.parseBoolean(cms.values_searchable)) {111 if (cms.values_searchable) { 112 112 tagSet.addAll(cms.getDisplayValues()); 113 113 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
r16043 r16045 74 74 } else if (def != null && usage.unused()) { 75 75 // default is set and all items were unset 76 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) {76 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || isForceUseLastAsDefault()) { 77 77 // selected osm primitives are untagged or filling default feature is enabled 78 78 combobox.setSelectedItem(lhm.get(def).getDisplayValue(true)); … … 85 85 // all items were unset (and so is default) 86 86 originalValue = lhm.get(""); 87 if (!presetInitiallyMatches && "force".equals(use_last_as_default) && LAST_VALUES.containsKey(key)) {87 if (!presetInitiallyMatches && isForceUseLastAsDefault() && LAST_VALUES.containsKey(key)) { 88 88 combobox.setSelectedItem(lhm.get(LAST_VALUES.get(key))); 89 89 } else { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r16043 r16045 91 91 */ 92 92 public char delimiter = ';'; // NOSONAR 93 /** whether the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".*/94 public String use_last_as_default = "false"; // NOSONAR93 /** whether the last value is used as default. Using "force" (2) enforces this behaviour also for already tagged objects. Default is "false" (0).*/ 94 public byte use_last_as_default = 0; // NOSONAR 95 95 /** whether to use values for search via {@link TaggingPresetSelector} */ 96 public String values_searchable = "false"; // NOSONAR96 public boolean values_searchable = false; // NOSONAR 97 97 98 98 protected JComponent component; … … 530 530 return; 531 531 532 if ( !"false".equals(use_last_as_default)) {532 if (isUseLastAsDefault()) { 533 533 LAST_VALUES.put(key, value); 534 534 } 535 535 changedTags.add(new Tag(key, value)); 536 } 537 538 public void setUse_last_as_default(String v) { 539 if ("force".equals(v)) { 540 use_last_as_default = 2; 541 } else if ("true".equals(v)) { 542 use_last_as_default = 1; 543 } else { 544 use_last_as_default = 0; 545 } 546 } 547 548 protected boolean isUseLastAsDefault() { 549 return use_last_as_default > 0; 550 } 551 552 protected boolean isForceUseLastAsDefault() { 553 return use_last_as_default == 2; 536 554 } 537 555 -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelect.java
r16042 r16045 34 34 originalValue = usage.getFirst(); 35 35 list.setSelectedItem(originalValue); 36 } else if ((def != null && !usage.hadKeys()) || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) {36 } else if ((def != null && !usage.hadKeys()) || PROP_FILL_DEFAULT.get() || isForceUseLastAsDefault()) { 37 37 originalValue = DIFFERENT; 38 38 list.setSelectedItem(def);
Note:
See TracChangeset
for help on using the changeset viewer.