Changeset 15358 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
- Timestamp:
- 2019-09-19T12:26:55+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r14153 r15358 7 7 import java.util.ArrayList; 8 8 import java.util.Collection; 9 import java.util.HashSet; 9 10 import java.util.LinkedHashSet; 10 11 import java.util.Set; … … 34 35 private Consumer<Collection<Object>> errorReporter; 35 36 37 private static final Set<String> NO_DATA_ERROR_MESSAGES = new HashSet<>(); 38 36 39 /** 37 40 * Creates a new {@link PostDownloadHandler} … … 54 57 this(task, future); 55 58 this.errorReporter = errorReporter; 59 } 60 61 /** 62 * Adds a new translated error message indicating that no data has been downloaded. 63 * @param message new translated error message indicating that no data has been downloaded. 64 * @return {@code true} if the message was not already known 65 * @since 15358 66 */ 67 public static boolean addNoDataErrorMessage(String message) { 68 return NO_DATA_ERROR_MESSAGES.add(message); 69 } 70 71 /** 72 * Determines if a translated error message indicates that no data has been downloaded. 73 * @param message translated error message to check 74 * @return {@code true} if the message indicates that no data has been downloaded 75 * @since 15358 76 */ 77 public static boolean isNoDataErrorMessage(Object message) { 78 return NO_DATA_ERROR_MESSAGES.contains(message); 56 79 } 57 80 … … 87 110 if (error instanceof Exception) { 88 111 ExceptionDialogUtil.explainException((Exception) error); 89 } else if ( tr("No data found in this area.").equals(error)) {112 } else if (isNoDataErrorMessage(error)) { 90 113 new Notification(error.toString()).setIcon(JOptionPane.WARNING_MESSAGE).show(); 91 114 } else {
Note:
See TracChangeset
for help on using the changeset viewer.