- Timestamp:
- 2018-04-12T01:18:50+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
r13613 r13617 12 12 import java.net.MalformedURLException; 13 13 import java.net.URL; 14 import java.util.Arrays; 15 import java.util.List; 16 import java.util.stream.Collectors; 14 17 15 18 import javax.swing.BorderFactory; … … 75 78 } 76 79 80 protected static List<String> getExamples() { 81 return Arrays.asList( 82 Main.getOSMWebsite()+"/history?open=true", 83 OsmApi.getOsmApi().getBaseUrl()+"/changesets?open=true"); 84 } 85 77 86 protected JPanel buildHelpPanel() { 78 87 String apiUrl = OsmApi.getOsmApi().getBaseUrl(); … … 83 92 + "<p><strong>" + tr("Examples") + "</strong></p>" 84 93 + "<ul>" 85 + "<li><a href=\""+Main.getOSMWebsite()+"/history?open=true\">"+Main.getOSMWebsite()+"/history?open=true</a></li>"86 +"<li><a href=\""+apiUrl+"/changesets?open=true\">"+apiUrl+"/changesets?open=true</a></li>"94 + String.join("", getExamples().stream().map( 95 s -> "<li><a href=\""+s+"\">"+s+"</a></li>").collect(Collectors.toList())) 87 96 + "</ul>" 88 97 + tr("Note that changeset queries are currently always submitted to ''{0}'', regardless of the " … … 121 130 } 122 131 123 protected boolean isValidChangesetQueryUrl(String text) { 132 protected static boolean isValidChangesetQueryUrl(String text) { 124 133 return buildChangesetQuery(text) != null; 125 134 } 126 135 127 protected ChangesetQuery buildChangesetQuery(String text) { 136 protected static ChangesetQuery buildChangesetQuery(String text) { 128 137 URL url = null; 129 138 try { … … 133 142 } 134 143 String path = url.getPath(); 135 if (path == null || !path.endsWith("/changesets")) 144 if (path == null || (!path.endsWith("/changesets") && !path.endsWith("/history"))) 136 145 return null; 137 146
Note:
See TracChangeset
for help on using the changeset viewer.