Index: src/org/openstreetmap/josm/actions/OpenLocationAction.java =================================================================== --- src/org/openstreetmap/josm/actions/OpenLocationAction.java (revision 6015) +++ src/org/openstreetmap/josm/actions/OpenLocationAction.java (working copy) @@ -146,7 +146,32 @@ return result; } + /** + * Summarizes acceptable urls for error message purposes. + * @since 6015 + */ + public String findSummaryDocumentation() { + String result = ""; + //for (Class taskClass : downloadTasks) { + for (int i = 0; i < downloadTasks.size(); i++) { + Class taskClass = downloadTasks.get(i); + if (taskClass != null) { + try { + DownloadTask task = taskClass.getConstructor().newInstance(); + result += "
" + task.acceptsDocumentationSummary(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + return result; + } + + + + + /** * Open the given URL. * @param new_layer true if the URL needs to be opened in a new layer, false otherwise * @param url The URL to open @@ -163,11 +188,12 @@ if (future != null) { Main.worker.submit(new PostDownloadHandler(task, future)); } else { + final String details = findSummaryDocumentation(); // Explain what patterns are supported SwingUtilities.invokeLater(new Runnable() { public void run() { JOptionPane.showMessageDialog(Main.parent, tr( - "Cannot open URL ''{0}'' because no suitable download task is available.", - url), tr("Download Location"), JOptionPane.ERROR_MESSAGE); + "

Cannot open URL ''{0}''
The following load tasks accept the URL patterns shown:
{1}

", + url, details), tr("Download Location"), JOptionPane.ERROR_MESSAGE); } }); } Index: src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java =================================================================== --- src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java (revision 6015) +++ src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmChangeTask.java (working copy) @@ -46,7 +46,15 @@ || url.matches("https?://.*/.*\\.osc") // Remote .osc files ); } - + @Override + public String acceptsDocumentationSummary() { + String foo = "Download OSM Change: