Changeset 18135 in josm for trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
- Timestamp:
- 2021-08-20T14:18:17+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r16553 r18135 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.actions; 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 4 6 import java.util.Collection; … … 7 9 import javax.swing.filechooser.FileFilter; 8 10 11 import org.openstreetmap.josm.gui.Notification; 12 import org.openstreetmap.josm.gui.util.GuiHelper; 9 13 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser; 10 14 import org.openstreetmap.josm.gui.widgets.FileChooserManager; 15 import org.openstreetmap.josm.tools.ImageProvider; 11 16 import org.openstreetmap.josm.tools.Shortcut; 12 17 … … 137 142 .openFileChooser(); 138 143 } 144 145 /** 146 * Show "saving file ..." notification and returns it, for future replacement. 147 * @param filename filename of file to save 148 * @return {@link Notification} to provide to {@link #showSavedNotification} once saving is successful 149 * @since 18135 150 */ 151 protected static Notification showSavingNotification(String filename) { 152 Notification savingNotification = new Notification(tr("Saving file {0}...", filename)).setIcon(ImageProvider.get("save")); 153 GuiHelper.runInEDT(savingNotification::show); 154 return savingNotification; 155 } 156 157 /** 158 * Show "Successfully saved file" notification and returns it. 159 * @param savingNotification {@link Notification} returned by {@link #showSavingNotification} 160 * @param filename filename of file saved 161 * @return {@code Notification} displayed 162 * @since 18135 163 */ 164 protected static Notification showSavedNotification(Notification savingNotification, String filename) { 165 Notification doneNotification = new Notification(tr("Successfully saved file {0}", filename)).setIcon(ImageProvider.get("save")); 166 GuiHelper.runInEDT(() -> doneNotification.replaceExisting(savingNotification)); 167 return doneNotification; 168 } 139 169 }
Note:
See TracChangeset
for help on using the changeset viewer.
