Changeset 30211 in osm for applications/editors/josm/plugins/opendata/src
- Timestamp:
- 2014-01-19T01:17:29+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/OdPlugin.java
r29854 r30211 121 121 JMenu moduleMenu = null; 122 122 for (AbstractDataSetHandler handler: module.getNewlyInstanciatedHandlers()) { 123 if (handler.getDataURL() != null || (handler.getDataURLs() != null && !handler.getDataURLs().isEmpty())) { 123 URL dataURL = handler.getDataURL(); 124 List<Pair<String, URL>> dataURLs = handler.getDataURLs(); 125 if (dataURL != null || (dataURLs != null && !dataURLs.isEmpty())) { 124 126 if (moduleMenu == null) { 125 127 moduleMenu = getModuleMenu(module); … … 142 144 } 143 145 JMenuItem handlerItem = null; 144 if ( handler.getDataURL()!= null) {145 handlerItem = endMenu.add(new DownloadDataAction(handlerName, handler.getDataURL()));146 } else if ( handler.getDataURLs()!= null) {146 if (dataURL != null) { 147 handlerItem = endMenu.add(new DownloadDataAction(module.getDisplayedName()+"_"+handlerName, dataURL)); 148 } else if (dataURLs != null) { 147 149 JMenu handlerMenu = new JMenu(handlerName); 148 150 JMenuItem item = null; 149 for (Pair<String, URL> pair : handler.getDataURLs()) {151 for (Pair<String, URL> pair : dataURLs) { 150 152 if (pair != null && pair.a != null && pair.b != null) { 151 153 item = handlerMenu.add(new DownloadDataAction(pair.a, pair.b)); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/AbstractDataSetHandler.java
r29686 r30211 427 427 428 428 public boolean acceptsUrl(String url) { 429 if (getDataURL() != null && url.equals(getDataURL().toString())) { 429 URL dataURL = getDataURL(); 430 if (dataURL != null && url.equals(dataURL.toString())) { 430 431 return true; 431 432 } 432 if (getDataURLs() != null) { 433 for (Pair<String, URL> pair : getDataURLs()) { 433 List<Pair<String, URL>> dataURLs = getDataURLs(); 434 if (dataURLs != null) { 435 for (Pair<String, URL> pair : dataURLs) { 434 436 if (pair.b != null && url.equals(pair.b.toString())) { 435 437 return true;
Note:
See TracChangeset
for help on using the changeset viewer.