Changeset 14668 in josm for trunk/src/org/openstreetmap/josm/gui/widgets
- Timestamp:
- 2019-01-08T21:33:32+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java
r14153 r14668 6 6 import java.util.Collection; 7 7 import java.util.Collections; 8 import java.util.function.Predicate; 8 9 9 10 import javax.swing.JFileChooser; … … 46 47 private int selectionMode = JFileChooser.FILES_ONLY; 47 48 private String extension; 48 private boolean allTypes;49 private Predicate<ExtensionFileFilter> additionalTypes = ignore -> false; 49 50 private File file; 50 51 … … 261 262 262 263 /** 264 * Builder method to set {@code additionalTypes} property. 265 * @param value matching types will additionally be added to the "file type" combobox. 266 * @return this 267 */ 268 public FileChooserManager additionalTypes(Predicate<ExtensionFileFilter> value) { 269 additionalTypes = value; 270 return this; 271 } 272 273 /** 263 274 * Builder method to set {@code allTypes} property. 264 275 * @param value If true, all the files types known by JOSM will be proposed in the "file type" combobox. … … 267 278 */ 268 279 public FileChooserManager allTypes(boolean value) { 269 a llTypes =value;280 additionalTypes = ignore -> value; 270 281 return this; 271 282 } … … 311 322 } 312 323 } else if (open) { 313 ExtensionFileFilter.applyChoosableImportFileFilters(fc, extension, a llTypes);324 ExtensionFileFilter.applyChoosableImportFileFilters(fc, extension, additionalTypes); 314 325 } else { 315 ExtensionFileFilter.applyChoosableExportFileFilters(fc, extension, a llTypes);326 ExtensionFileFilter.applyChoosableExportFileFilters(fc, extension, additionalTypes); 316 327 } 317 328 return this;
Note:
See TracChangeset
for help on using the changeset viewer.