Changeset 30100 in osm for applications/editors/josm
- Timestamp:
- 2013-11-28T18:19:44+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/wikipedia/src/org/wikipedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
r30074 r30100 251 251 static class WikipediaEntry implements Comparable<WikipediaEntry> { 252 252 253 final String name , description;253 final String name; 254 254 final String wikipediaLang, wikipediaArticle; 255 255 final LatLon coordinate; … … 258 258 public WikipediaEntry(String name, String description, LatLon coordinate) { 259 259 this.name = name; 260 this.description = description;261 260 this.coordinate = coordinate; 262 261 263 final WikipediaLangArticle wp = WikipediaLangArticle.parseFromUrl(getHrefFromDescription( ));262 final WikipediaLangArticle wp = WikipediaLangArticle.parseFromUrl(getHrefFromDescription(description)); 264 263 if (wp == null) { 265 System.err.println("Could not extract Wikipedia tag from: " + getHrefFromDescription( ));264 System.err.println("Could not extract Wikipedia tag from: " + getHrefFromDescription(description)); 266 265 } 267 266 this.wikipediaLang = wp == null ? null : wp.lang; … … 271 270 public WikipediaEntry(String name, String wikipediaLang, String wikipediaArticle) { 272 271 this.name = name; 273 this.description = null;274 272 this.wikipediaLang = wikipediaLang; 275 273 this.wikipediaArticle = wikipediaArticle; … … 277 275 } 278 276 279 protected final String getHrefFromDescription( ) {277 protected final String getHrefFromDescription(final String description) { 280 278 if (description == null) { 281 279 return null; … … 316 314 317 315 public String getBrowserUrl() { 318 if (getHrefFromDescription() != null) { 319 return getHrefFromDescription().replace(" ", "_"); 320 } else { 321 return "http://" + wikipediaLang + ".wikipedia.org/wiki/" 322 + encodeURL(wikipediaArticle.replace(" ", "_")); 323 } 316 return "http://" + wikipediaLang + ".wikipedia.org/wiki/" 317 + encodeURL(wikipediaArticle.replace(" ", "_")); 324 318 } 325 319 -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
r29854 r30100 96 96 label.setToolTipText(tr("Not linked yet")); 97 97 } 98 if (entry.description != null) {99 label.setToolTipText("<html>" + entry.description + "</html>");100 }101 98 return label; 102 99 }
Note:
See TracChangeset
for help on using the changeset viewer.