- Timestamp:
- 2012-11-08T18:54:08+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
r5438 r5573 8 8 import java.io.File; 9 9 import java.io.IOException; 10 import java.util.Arrays; 10 11 import java.util.List; 11 12 … … 19 20 import org.openstreetmap.josm.gui.layer.Layer; 20 21 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 22 import org.openstreetmap.josm.gui.util.FileFilterAllFiles; 21 23 import org.openstreetmap.josm.io.IllegalDataException; 22 24 import org.openstreetmap.josm.io.session.SessionReader; … … 31 33 public void actionPerformed(ActionEvent e) { 32 34 ExtensionFileFilter ff = new ExtensionFileFilter("jos,joz", "jos", tr("Session file (*.jos, *.joz)")); 33 JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), ff, JFileChooser.FILES_ONLY, "lastDirectory");35 JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), Arrays.asList(ff, FileFilterAllFiles.getInstance()), ff, JFileChooser.FILES_ONLY, "lastDirectory"); 34 36 if (fc == null) return; 35 37 File file = fc.getSelectedFile(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
r5538 r5573 12 12 import java.awt.Point; 13 13 import java.awt.Rectangle; 14 import java.awt.Window;15 14 import java.awt.event.ActionEvent; 16 15 import java.awt.event.ActionListener; 17 16 import java.awt.event.KeyEvent; 18 17 import java.awt.event.MouseEvent; 19 import java.awt.event.WindowAdapter;20 import java.awt.event.WindowEvent;21 18 import java.io.BufferedInputStream; 22 19 import java.io.BufferedOutputStream; … … 54 51 import javax.swing.event.ListSelectionEvent; 55 52 import javax.swing.event.ListSelectionListener; 53 import javax.swing.filechooser.FileFilter; 56 54 import javax.swing.table.AbstractTableModel; 57 55 import javax.swing.table.DefaultTableCellRenderer; … … 60 58 61 59 import org.openstreetmap.josm.Main; 60 import org.openstreetmap.josm.actions.ExtensionFileFilter; 62 61 import org.openstreetmap.josm.gui.ExtendedDialog; 63 62 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 67 66 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener; 68 67 import org.openstreetmap.josm.gui.mappaint.StyleSource; 68 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 69 69 import org.openstreetmap.josm.gui.preferences.PreferenceDialog; 70 70 import org.openstreetmap.josm.gui.preferences.SourceEntry; 71 import org.openstreetmap.josm.gui.util.FileFilterAllFiles; 71 72 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 72 73 import org.openstreetmap.josm.gui.widgets.JFileChooserManager; … … 484 485 JFileChooserManager fcm = new JFileChooserManager(false, "mappaint.clone-style.lastDirectory", System.getProperty("user.home")); 485 486 String suggestion = fcm.getInitialDirectory() + File.separator + s.getFileNamePart(); 486 fcm.createFileChooser().getFileChooser().setSelectedFile(new File(suggestion)); 487 488 FileFilter ff; 489 if (s instanceof MapCSSStyleSource) { 490 ff = new ExtensionFileFilter("mapcss,css", "mapcss", tr("Map paint style file (*.mapcss)")); 491 } else { 492 ff = new ExtensionFileFilter("xml", "xml", tr("Map paint style file (*.xml)")); 493 } 494 fcm.createFileChooser(false, null, Arrays.asList(ff, FileFilterAllFiles.getInstance()), ff, JFileChooser.FILES_ONLY) 495 .getFileChooser().setSelectedFile(new File(suggestion)); 487 496 JFileChooser fc = fcm.openFileChooser(); 488 497 if (fc == null)
Note:
See TracChangeset
for help on using the changeset viewer.