Changeset 18314 in josm
- Timestamp:
- 2021-11-07T14:24:15+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r18238 r18314 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static javax.swing.JFileChooser.FILES_AND_DIRECTORIES; 4 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 5 6 import static org.openstreetmap.josm.tools.I18n.tr; … … 29 30 import java.util.stream.Stream; 30 31 31 import javax.swing.JFileChooser;32 32 import javax.swing.JOptionPane; 33 33 import javax.swing.SwingUtilities; … … 45 45 import org.openstreetmap.josm.gui.util.GuiHelper; 46 46 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; 47 import org.openstreetmap.josm.gui.widgets.FileChooserManager; 48 import org.openstreetmap.josm.gui.widgets.NativeFileChooser; 47 49 import org.openstreetmap.josm.io.OsmTransferException; 48 50 import org.openstreetmap.josm.spi.preferences.Config; … … 79 81 @Override 80 82 public void actionPerformed(ActionEvent e) { 81 AbstractFileChooser fc = createAndOpenFileChooser(true, true, null, null, JFileChooser.FILES_AND_DIRECTORIES, 82 true, null); 83 final AbstractFileChooser fc; 84 // If the user explicitly wants native file dialogs, let them use it. 85 // Rather unfortunately, this means that they will not be able to select files and directories. 86 if (FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.get() 87 // This is almost redundant, as the JDK currently doesn't support this with (all?) native file choosers. 88 && !NativeFileChooser.supportsSelectionMode(FILES_AND_DIRECTORIES)) { 89 fc = createAndOpenFileChooser(true, true, null); 90 } else { 91 fc = createAndOpenFileChooser(true, true, null, null, FILES_AND_DIRECTORIES, true, null); 92 } 83 93 if (fc == null) 84 94 return;
Note:
See TracChangeset
for help on using the changeset viewer.