- Timestamp:
- 2018-10-17T02:30:45+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r14153 r14340 42 42 } 43 43 44 private static int showErrorDialog(String msg, String title, String helpTopic) { 45 return HelpAwareOptionPane.showOptionDialog( 46 MainApplication.getMainFrame(), 47 new HtmlPanel(msg), 48 title, 49 JOptionPane.ERROR_MESSAGE, 50 helpTopic 51 ); 52 } 53 44 54 /** 45 55 * handles an exception caught during OSM API initialization … … 48 58 */ 49 59 public static void explainOsmApiInitializationException(OsmApiInitializationException e) { 50 HelpAwareOptionPane.showOptionDialog( 51 MainApplication.getMainFrame(), 60 showErrorDialog( 52 61 ExceptionUtil.explainOsmApiInitializationException(e), 53 62 tr("Error"), 54 JOptionPane.ERROR_MESSAGE,55 63 ht("/ErrorMessages#OsmApiInitializationException") 56 64 ); … … 63 71 */ 64 72 public static void explainChangesetClosedException(ChangesetClosedException e) { 65 HelpAwareOptionPane.showOptionDialog( 66 MainApplication.getMainFrame(), 73 showErrorDialog( 67 74 ExceptionUtil.explainChangesetClosedException(e), 68 75 tr("Error"), 69 JOptionPane.ERROR_MESSAGE,70 76 ht("/Action/Upload#ChangesetClosed") 71 77 ); … … 78 84 */ 79 85 public static void explainPreconditionFailed(OsmApiException e) { 80 HelpAwareOptionPane.showOptionDialog( 81 MainApplication.getMainFrame(), 86 showErrorDialog( 82 87 ExceptionUtil.explainPreconditionFailed(e), 83 88 tr("Precondition violation"), 84 JOptionPane.ERROR_MESSAGE,85 89 ht("/ErrorMessages#OsmApiException") 86 90 ); … … 104 108 * @param e the exception 105 109 */ 106 107 110 public static void explainSecurityException(OsmTransferException e) { 108 HelpAwareOptionPane.showOptionDialog( 109 MainApplication.getMainFrame(), 111 showErrorDialog( 110 112 ExceptionUtil.explainSecurityException(e), 111 113 tr("Security exception"), 112 JOptionPane.ERROR_MESSAGE,113 114 ht("/ErrorMessages#SecurityException") 114 115 ); … … 122 123 * @param e the exception 123 124 */ 124 125 125 public static void explainNestedSocketException(OsmTransferException e) { 126 HelpAwareOptionPane.showOptionDialog( 127 MainApplication.getMainFrame(), 126 showErrorDialog( 128 127 ExceptionUtil.explainNestedSocketException(e), 129 128 tr("Network exception"), 130 JOptionPane.ERROR_MESSAGE,131 129 ht("/ErrorMessages#NestedSocketException") 132 130 ); … … 140 138 * @param e the exception 141 139 */ 142 143 140 public static void explainNestedIOException(OsmTransferException e) { 144 HelpAwareOptionPane.showOptionDialog( 145 MainApplication.getMainFrame(), 141 showErrorDialog( 146 142 ExceptionUtil.explainNestedIOException(e), 147 143 tr("IO Exception"), 148 JOptionPane.ERROR_MESSAGE,149 144 ht("/ErrorMessages#NestedIOException") 150 145 ); … … 158 153 */ 159 154 public static void explainNestedIllegalDataException(OsmTransferException e) { 160 HelpAwareOptionPane.showOptionDialog( 161 MainApplication.getMainFrame(), 155 showErrorDialog( 162 156 ExceptionUtil.explainNestedIllegalDataException(e), 163 157 tr("Illegal Data"), 164 JOptionPane.ERROR_MESSAGE,165 158 ht("/ErrorMessages#IllegalDataException") 166 159 ); … … 175 168 */ 176 169 public static void explainNestedOfflineAccessException(OsmTransferException e) { 177 HelpAwareOptionPane.showOptionDialog( 178 MainApplication.getMainFrame(), 170 showErrorDialog( 179 171 ExceptionUtil.explainOfflineAccessException(e), 180 172 tr("Offline mode"), 181 JOptionPane.ERROR_MESSAGE,182 173 ht("/ErrorMessages#OfflineAccessException") 183 174 ); … … 203 194 * @param e the exception 204 195 */ 205 206 196 public static void explainInternalServerError(OsmTransferException e) { 207 HelpAwareOptionPane.showOptionDialog( 208 MainApplication.getMainFrame(), 197 showErrorDialog( 209 198 ExceptionUtil.explainInternalServerError(e), 210 199 tr("Internal Server Error"), 211 JOptionPane.ERROR_MESSAGE,212 200 ht("/ErrorMessages#InternalServerError") 213 201 ); … … 221 209 */ 222 210 public static void explainBadRequest(OsmApiException e) { 223 HelpAwareOptionPane.showOptionDialog( 224 MainApplication.getMainFrame(), 211 showErrorDialog( 225 212 ExceptionUtil.explainBadRequest(e), 226 213 tr("Bad Request"), 227 JOptionPane.ERROR_MESSAGE,228 214 ht("/ErrorMessages#BadRequest") 229 215 ); … … 237 223 */ 238 224 public static void explainNotFound(OsmApiException e) { 239 HelpAwareOptionPane.showOptionDialog( 240 MainApplication.getMainFrame(), 225 showErrorDialog( 241 226 ExceptionUtil.explainNotFound(e), 242 227 tr("Not Found"), 243 JOptionPane.ERROR_MESSAGE,244 228 ht("/ErrorMessages#NotFound") 245 229 ); … … 252 236 */ 253 237 public static void explainConflict(OsmApiException e) { 254 HelpAwareOptionPane.showOptionDialog( 255 MainApplication.getMainFrame(), 238 showErrorDialog( 256 239 ExceptionUtil.explainConflict(e), 257 240 tr("Conflict"), 258 JOptionPane.ERROR_MESSAGE,259 241 ht("/ErrorMessages#Conflict") 260 242 ); … … 275 257 } 276 258 277 HelpAwareOptionPane.showOptionDialog( 278 MainApplication.getMainFrame(), 259 showErrorDialog( 279 260 msg, 280 261 tr("Authentication failed"), 281 JOptionPane.ERROR_MESSAGE,282 262 ht("/ErrorMessages#AuthenticationFailed") 283 263 ); … … 312 292 } 313 293 314 HelpAwareOptionPane.showOptionDialog( 315 MainApplication.getMainFrame(), 294 showErrorDialog( 316 295 msg, 317 296 tr("Authorisation Failed"), 318 JOptionPane.ERROR_MESSAGE,319 297 ht("/ErrorMessages#AuthorizationFailed") 320 298 ); … … 328 306 */ 329 307 public static void explainClientTimeout(OsmApiException e) { 330 HelpAwareOptionPane.showOptionDialog( 331 MainApplication.getMainFrame(), 308 showErrorDialog( 332 309 ExceptionUtil.explainClientTimeout(e), 333 310 tr("Client Time Out"), 334 JOptionPane.ERROR_MESSAGE,335 311 ht("/ErrorMessages#ClientTimeOut") 336 312 ); … … 344 320 */ 345 321 public static void explainBandwidthLimitExceeded(OsmApiException e) { 346 HelpAwareOptionPane.showOptionDialog( 347 MainApplication.getMainFrame(), 322 showErrorDialog( 348 323 ExceptionUtil.explainBandwidthLimitExceeded(e), 349 324 tr("Bandwidth Limit Exceeded"), 350 JOptionPane.ERROR_MESSAGE,351 325 ht("/ErrorMessages#BandwidthLimit") 352 326 ); … … 382 356 */ 383 357 public static void explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) { 384 HelpAwareOptionPane.showOptionDialog( 385 MainApplication.getMainFrame(), 358 showErrorDialog( 386 359 ExceptionUtil.explainMissingOAuthAccessTokenException(e), 387 360 tr("Authentication failed"), 388 JOptionPane.ERROR_MESSAGE,389 361 ht("/ErrorMessages#MissingOAuthAccessToken") 390 362 ); … … 399 371 */ 400 372 public static void explainNestedUnkonwnHostException(OsmTransferException e) { 401 HelpAwareOptionPane.showOptionDialog( 402 MainApplication.getMainFrame(), 373 showErrorDialog( 403 374 ExceptionUtil.explainNestedUnknownHostException(e), 404 375 tr("Unknown host"), 405 JOptionPane.ERROR_MESSAGE,406 376 ht("/ErrorMessages#UnknownHost") 407 377 ); … … 502 472 */ 503 473 public static void explainGoneForUnknownPrimitive(OsmApiException e) { 504 HelpAwareOptionPane.showOptionDialog( 505 MainApplication.getMainFrame(), 474 showErrorDialog( 506 475 ExceptionUtil.explainGoneForUnknownPrimitive(e), 507 476 tr("Object deleted"), 508 JOptionPane.ERROR_MESSAGE,509 477 ht("/ErrorMessages#GoneForUnknownPrimitive") 510 478 );
Note:
See TracChangeset
for help on using the changeset viewer.