Changeset 6772 in josm
- Timestamp:
- 2014-01-29T21:14:07+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r6738 r6772 275 275 } 276 276 277 static boolean presetInitiallyMatches = false; 278 277 279 @Override 278 280 public void actionPerformed(ActionEvent e) { … … 281 283 282 284 Collection<OsmPrimitive> sel = createSelection(Main.main.getCurrentDataSet().getSelected()); 285 presetInitiallyMatches = !sel.isEmpty() && Utils.forAll(sel, this); 283 286 int answer = showDialog(sel, supportsRelation()); 284 287 -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r6699 r6772 597 597 else if (!usage.hadKeys() || PROP_FILL_DEFAULT.get() || "force".equals(use_last_as_default)) { 598 598 // selected osm primitives are untagged or filling default values feature is enabled 599 if (!"false".equals(use_last_as_default) && lastValue.containsKey(key) ) {599 if (!"false".equals(use_last_as_default) && lastValue.containsKey(key) && !TaggingPreset.presetInitiallyMatches) { 600 600 textField.setText(lastValue.get(key)); 601 601 } else { … … 1227 1227 // all items were unset (and so is default) 1228 1228 originalValue = lhm.get(""); 1229 if ("force".equals(use_last_as_default) && lastValue.containsKey(key) ) {1229 if ("force".equals(use_last_as_default) && lastValue.containsKey(key) && !TaggingPreset.presetInitiallyMatches) { 1230 1230 combo.setSelectedItem(lhm.get(lastValue.get(key))); 1231 1231 } else { -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6749 r6772 65 65 public static final Charset UTF_8 = Charset.forName("UTF-8"); 66 66 67 /** 68 * Tests whether {@code predicate} applies to at least one elements from {@code collection}. 69 */ 67 70 public static <T> boolean exists(Iterable<? extends T> collection, Predicate<? super T> predicate) { 68 71 for (T item : collection) { … … 71 74 } 72 75 return false; 76 } 77 78 /** 79 * Tests whether {@code predicate} applies to all elements from {@code collection}. 80 */ 81 public static <T> boolean forAll(Iterable<? extends T> collection, Predicate<? super T> predicate) { 82 return !exists(collection, Predicates.not(predicate)); 73 83 } 74 84
Note:
See TracChangeset
for help on using the changeset viewer.