- Timestamp:
- 2011-07-09T21:54:22+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r4185 r4218 236 236 public String default_; 237 237 public String originalValue; 238 public boolean use_last_as_default = false;238 public String use_last_as_default = "false"; 239 239 public boolean delete_if_empty = false; 240 240 public boolean required = false; … … 249 249 initAutoCompletionField(textField, key); 250 250 if (usage.unused()){ 251 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() ) {251 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 252 252 // selected osm primitives are untagged or filling default values feature is enabled 253 if ( use_last_as_default&& lastValue.containsKey(key)) {253 if (!"false".equals(use_last_as_default) && lastValue.containsKey(key)) { 254 254 textField.setText(lastValue.get(key)); 255 255 } else { … … 297 297 ((JTextField)value).getText(); 298 298 299 if ( use_last_as_default) {299 if (!"false".equals(use_last_as_default)) { 300 300 lastValue.put(key, v); 301 301 } … … 319 319 public String value_off = OsmUtils.falseval; 320 320 public boolean default_ = false; // only used for tagless objects 321 public boolean use_last_as_default = false;322 321 public boolean required = false; 323 322 … … 411 410 public boolean delete_if_empty = false; 412 411 public boolean editable = true; 413 public boolean use_last_as_default = false;412 public String use_last_as_default = "false"; 414 413 public boolean required = false; 415 414 … … 446 445 } 447 446 448 if ( use_last_as_default&& def == null && lastValue.containsKey(key)) {447 if (!"false".equals(use_last_as_default) && def == null && lastValue.containsKey(key)) { 449 448 def = lastValue.get(key); 450 449 } … … 503 502 else if (def != null && usage.unused()) { 504 503 // default is set and all items were unset 505 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() ) {504 if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 506 505 // selected osm primitives are untagged or filling default feature is enabled 507 506 combo.setSelectedItem(def); … … 605 604 value = null; 606 605 } 607 if ( use_last_as_default) {606 if (!"false".equals(use_last_as_default)) { 608 607 lastValue.put(key, value); 609 608 } … … 681 680 public String delimiter = ";"; 682 681 public boolean delete_if_empty = false; 683 public boolean use_last_as_default = false;682 public String use_last_as_default = "false"; 684 683 public boolean required = false; 685 684 public long rows = -1; … … 722 721 } 723 722 724 if ( use_last_as_default&& def == null && lastValue.containsKey(key)) {723 if (!"false".equals(use_last_as_default) && def == null && lastValue.containsKey(key)) { 725 724 def = lastValue.get(key); 726 725 } … … 758 757 if (usage.hasUniqueValue() && !usage.unused()) { 759 758 originalValue=usage.getFirst(); 760 } 761 else if (def != null && !usage.hadKeys()) { 762 originalValue=def; 759 list.setSelectedItem(originalValue); 760 } 761 else if (def != null && !usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 762 originalValue=DIFFERENT; 763 list.setSelectedItem(def); 763 764 } 764 765 else if (usage.unused()) { 765 766 originalValue=null; 767 list.setSelectedItem(originalValue); 766 768 } 767 769 else { 768 770 originalValue=DIFFERENT; 769 }770 list.setSelectedItem(originalValue);771 list.setSelectedItem(originalValue); 772 } 771 773 772 774 if (locale_text == null) { … … 859 861 value = null; 860 862 } 861 if ( use_last_as_default) {863 if (!"false".equals(use_last_as_default)) { 862 864 lastValue.put(key, value); 863 865 }
Note:
See TracChangeset
for help on using the changeset viewer.