Ignore:
Timestamp:
2013-06-26T21:04:53+02:00 (11 years ago)
Author:
akks
Message:

see #8809: [patch by brycenesbitt, reworked] detailed documentation for "no suitable download task is available" error (Ctrl-L)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r5782 r6031  
    4949   
    5050    protected String newLayerName = null;
     51   
     52    @Override
     53    public String[] getPatterns() {
     54        if (this.getClass() == DownloadOsmTask.class) {
     55            return new String[]{PATTERN_OSM_API_URL, PATTERN_OVERPASS_API_URL,
     56                PATTERN_OVERPASS_API_XAPI_URL, PATTERN_EXTERNAL_OSM_FILE};
     57        } else {
     58            return super.getPatterns();
     59        }
     60    }
     61
     62    @Override
     63    public String getTitle() {
     64        if (this.getClass() == DownloadOsmTask.class) {
     65            return tr("Download OSM");
     66        } else {
     67            return super.getTitle();
     68        }
     69    }
    5170
    5271    protected void rememberDownloadedData(DataSet ds) {
     
    136155     * @param url The URL as String
    137156     */
     157    @Override
    138158    public Future<?> loadUrl(boolean new_layer, String url, ProgressMonitor progressMonitor) {
    139159        if (url.matches(PATTERN_OVERPASS_API_URL)) {
     
    156176        newLayerName = matcher.matches() ? matcher.group(1) : null;
    157177    }
    158    
    159     /* (non-Javadoc)
    160      * @see org.openstreetmap.josm.actions.downloadtasks.DownloadTask#acceptsUrl(java.lang.String)
    161      */
    162     @Override
    163     public boolean acceptsUrl(String url) {
    164         return url != null && (
    165                 url.matches(PATTERN_OSM_API_URL)           // OSM API 0.6 and XAPI
    166              || url.matches(PATTERN_OVERPASS_API_URL)      // Overpass API
    167              || url.matches(PATTERN_OVERPASS_API_XAPI_URL) // Overpass API XAPI compatibility layer
    168              || url.matches(PATTERN_EXTERNAL_OSM_FILE)     // Remote .osm files
    169                 );
    170     }
    171 
     178
     179    @Override
    172180    public void cancel() {
    173181        if (downloadTask != null) {
Note: See TracChangeset for help on using the changeset viewer.