Changeset 16089 in josm for trunk/src/org
- Timestamp:
- 2020-03-08T20:17:00+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r16063 r16089 363 363 @Override 364 364 public Collection<String> getValues() { 365 initListEntries( );365 initListEntries(false); 366 366 return presetListEntries.stream().map(x -> x.value).collect(Collectors.toSet()); 367 367 } … … 372 372 */ 373 373 public Collection<String> getDisplayValues() { 374 initListEntries( );374 initListEntries(false); 375 375 return presetListEntries.stream().map(PresetListEntry::getDisplayValue).collect(Collectors.toList()); 376 376 } … … 378 378 @Override 379 379 public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel, boolean presetInitiallyMatches) { 380 initListEntries( );380 initListEntries(true); 381 381 382 382 // find out if our key is already used in the selection. … … 396 396 } 397 397 398 private void initListEntries( ) {398 private void initListEntries(boolean cleanup) { 399 399 if (initialized) { 400 presetListEntries.remove(new PresetListEntry(DIFFERENT)); // possibly added in #addToPanel 400 if (cleanup) { // do not cleanup for #getDisplayValues used in Combo#addToPanelAnchor 401 presetListEntries.remove(new PresetListEntry(DIFFERENT)); // possibly added in #addToPanel 402 } 401 403 return; 402 404 } else if (presetListEntries.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.