Ignore:
Timestamp:
2017-08-06T20:13:06+02:00 (7 years ago)
Author:
michael2402
Message:

Apply #15057: Improve the over pass turbo dialog

Adds the ability to add favorites and a new wizard dialog with examples.

File:
1 edited

Legend:

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

    r12307 r12574  
    1212import java.util.concurrent.ExecutionException;
    1313import java.util.concurrent.Future;
     14import java.util.function.Consumer;
    1415
    1516import javax.swing.JOptionPane;
     
    2930    private final DownloadTask task;
    3031    private final Future<?> future;
     32    private Consumer<Collection> errorReporter;
    3133
    3234    /**
     
    3840        this.task = task;
    3941        this.future = future;
     42    }
     43
     44    /**
     45     * constructor
     46     * @param task the asynchronous download task
     47     * @param future the future on which the completion of the download task can be synchronized
     48     * @param errorReporter a callback to inform about the number errors happened during the download
     49     *                      task
     50     */
     51    public PostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection> errorReporter) {
     52        this(task, future);
     53        this.errorReporter = errorReporter;
    4054    }
    4155
     
    5468        //
    5569        Set<Object> errors = new LinkedHashSet<>(task.getErrorObjects());
    56         if (errors.isEmpty())
     70        if (this.errorReporter != null) {
     71            errorReporter.accept(errors);
     72        }
     73
     74        if (errors.isEmpty()) {
    5775            return;
     76        }
    5877
    5978        // just one error object?
Note: See TracChangeset for help on using the changeset viewer.