Пример #1
0
 @Override
 public void run() {
   GuiHelper.runInEDTAndWait(
       () -> {
         model.setMode(SaveLayersModel.Mode.UPLOADING_AND_SAVING);
         List<SaveLayerInfo> toUpload = model.getLayersToUpload();
         if (!toUpload.isEmpty()) {
           uploadLayers(toUpload);
         }
         List<SaveLayerInfo> toSave = model.getLayersToSave();
         if (!toSave.isEmpty()) {
           saveLayers(toSave);
         }
         model.setMode(SaveLayersModel.Mode.EDITING_DATA);
         if (model.hasUnsavedData()) {
           warnBecauseOfUnsavedData();
           model.setMode(Mode.EDITING_DATA);
           if (canceled) {
             setUserAction(UserAction.CANCEL);
             closeDialog();
           }
         } else {
           setUserAction(UserAction.PROCEED);
           closeDialog();
         }
       });
   worker.shutdownNow();
 }
Пример #2
0
 protected void cancelSafeAndUploadTask() {
   if (this.saveAndUploadTask != null) {
     this.saveAndUploadTask.cancel();
   }
   model.setMode(Mode.EDITING_DATA);
 }