this.worker = Executors.newSingleThreadExecutor();
}
protected void uploadLayers(List<SaveLayerInfo> toUpload) {
for (final SaveLayerInfo layerInfo: toUpload) {
ModifiableLayer layer = layerInfo.getLayer();
if (canceled) {
model.setUploadState(layer, UploadOrSaveState.CANCELED);
continue;
}
monitor.subTask(tr("Preparing layer ''{0}'' for upload ...", layerInfo.getName()));
if (!UploadAction.checkPreUploadConditions(layer)) {
model.setUploadState(layer, UploadOrSaveState.FAILED);
continue;
}
AbstractUploadDialog dialog = layer.getUploadDialog();
if (dialog != null) {
dialog.setVisible(true);
if (dialog.isCanceled()) {
model.setUploadState(layer, UploadOrSaveState.CANCELED);
continue;
}
dialog.rememberUserInput();
}
currentTask = layer.createUploadTask(monitor);
if (currentTask == null) {
model.setUploadState(layer, UploadOrSaveState.FAILED);
continue;
}
currentFuture = worker.submit(currentTask);