diff --git src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java
index 815c33918..8794931f4 100644
|
|
|
import java.awt.HeadlessException;
|
| 6 | 6 | import java.io.File; |
| 7 | 7 | import java.util.Locale; |
| 8 | 8 | |
| | 9 | import javax.swing.ActionMap; |
| 9 | 10 | import javax.swing.filechooser.FileFilter; |
| 10 | 11 | |
| 11 | 12 | /** |
| … |
… |
public abstract class AbstractFileChooser {
|
| 214 | 215 | * @see java.awt.GraphicsEnvironment#isHeadless |
| 215 | 216 | */ |
| 216 | 217 | public abstract int showSaveDialog(Component parent); |
| | 218 | |
| | 219 | /** |
| | 220 | * Gets the list of action names. |
| | 221 | * |
| | 222 | * @return a <code>ActionMap</code> array containing all the action names |
| | 223 | * |
| | 224 | */ |
| | 225 | public abstract ActionMap getActionMap(); |
| 217 | 226 | } |
diff --git src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java
index 32d60db52..0973c2fd0 100644
|
|
|
import java.util.Collection;
|
| 7 | 7 | import java.util.Collections; |
| 8 | 8 | import java.util.function.Predicate; |
| 9 | 9 | |
| | 10 | import javax.swing.Action; |
| 10 | 11 | import javax.swing.JFileChooser; |
| 11 | 12 | import javax.swing.filechooser.FileFilter; |
| 12 | 13 | |
| … |
… |
public class FileChooserManager {
|
| 36 | 37 | // Native dialogs do not support file filters, so do not set them as default, except for OS X where they never worked |
| 37 | 38 | PlatformManager.isPlatformOsx()); |
| 38 | 39 | |
| | 40 | /** |
| | 41 | * Property to use the details view in file dialogs. |
| | 42 | */ |
| | 43 | public static final BooleanProperty PROP_USE_DETAILS_VIEW_FILE_DIALOG = new BooleanProperty("use.details.view.file.dialog", false); |
| | 44 | |
| 39 | 45 | private final boolean open; |
| 40 | 46 | private final String lastDirProperty; |
| 41 | 47 | private final String curDir; |
| … |
… |
public class FileChooserManager {
|
| 302 | 308 | fc = new NativeFileChooser(f); |
| 303 | 309 | } else { |
| 304 | 310 | fc = new SwingFileChooser(f); |
| | 311 | if (PROP_USE_DETAILS_VIEW_FILE_DIALOG.get()) { |
| | 312 | Action details = fc.getActionMap().get("viewTypeDetails"); |
| | 313 | details.actionPerformed(null); |
| | 314 | } |
| 305 | 315 | } |
| 306 | 316 | |
| 307 | 317 | if (title != null) { |
diff --git src/org/openstreetmap/josm/gui/widgets/SwingFileChooser.java src/org/openstreetmap/josm/gui/widgets/SwingFileChooser.java
index 8ec6a7d2f..bf6ccb037 100644
|
|
|
package org.openstreetmap.josm.gui.widgets;
|
| 4 | 4 | import java.awt.Component; |
| 5 | 5 | import java.io.File; |
| 6 | 6 | |
| | 7 | import javax.swing.ActionMap; |
| 7 | 8 | import javax.swing.JFileChooser; |
| 8 | 9 | import javax.swing.filechooser.FileFilter; |
| 9 | 10 | |
| … |
… |
public class SwingFileChooser extends AbstractFileChooser {
|
| 105 | 106 | jFileChooser.setLocale(locale); |
| 106 | 107 | return jFileChooser.showSaveDialog(parent); |
| 107 | 108 | } |
| | 109 | |
| | 110 | @Override |
| | 111 | public ActionMap getActionMap() { |
| | 112 | return jFileChooser.getActionMap(); |
| | 113 | } |
| 108 | 114 | } |