Changeset 2168 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2009-09-20T11:46:08+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 5 added
- 1 edited
- 1 moved
-
UploadAction.java (modified) (5 diffs)
-
upload (added)
-
upload/ApiPreconditionCheckerHook.java (moved) (moved from trunk/src/org/openstreetmap/josm/actions/ApiPreconditionChecker.java ) (3 diffs)
-
upload/CyclicUploadDependencyException.java (added)
-
upload/RelationUploadOrderHook.java (added)
-
upload/UploadHook.java (added)
-
upload/UploadParameterHook.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2153 r2168 19 19 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.actions.upload.ApiPreconditionCheckerHook; 22 import org.openstreetmap.josm.actions.upload.RelationUploadOrderHook; 23 import org.openstreetmap.josm.actions.upload.UploadHook; 24 import org.openstreetmap.josm.actions.upload.UploadParameterHook; 21 25 import org.openstreetmap.josm.data.APIDataSet; 22 26 import org.openstreetmap.josm.data.conflict.ConflictCollection; … … 67 71 * Checks server capabilities before upload. 68 72 */ 69 uploadHooks.add(new ApiPreconditionChecker()); 73 uploadHooks.add(new ApiPreconditionCheckerHook()); 74 75 /** 76 * Adjusts the upload order of new relations 77 */ 78 uploadHooks.add(new RelationUploadOrderHook()); 70 79 71 80 /** … … 73 82 * give the user the possibility to cancel the upload. 74 83 */ 75 uploadHooks.add(new Upload ConfirmationHook());84 uploadHooks.add(new UploadParameterHook()); 76 85 } 77 86 … … 99 108 } 100 109 } 101 102 /** Upload Hook */103 public interface UploadHook {104 /**105 * Checks the upload.106 * @param apiDataSet the data to upload107 */108 public boolean checkUpload(APIDataSet apiDataSet);109 }110 111 110 112 111 public UploadAction() { … … 483 482 } 484 483 485 486 static public class UploadConfirmationHook implements UploadHook {487 488 public boolean checkUpload(APIDataSet apiData) {489 final UploadDialog dialog = UploadDialog.getUploadDialog();490 dialog.setUploadedPrimitives(apiData.getPrimitivesToAdd(),apiData.getPrimitivesToUpdate(), apiData.getPrimitivesToDelete());491 dialog.setVisible(true);492 if (dialog.isCanceled())493 return false;494 dialog.rememberUserInput();495 return true;496 }497 }498 499 484 public UploadDiffTask createUploadTask(OsmDataLayer layer, Collection<OsmPrimitive> toUpload, Changeset changeset, boolean closeChangesetAfterUpload) { 500 485 return new UploadDiffTask(layer, toUpload, changeset, closeChangesetAfterUpload); -
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r2156 r2168 1 package org.openstreetmap.josm.actions; 1 package org.openstreetmap.josm.actions.upload; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 10 10 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.actions.UploadAction.UploadHook;13 12 import org.openstreetmap.josm.data.APIDataSet; 14 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 19 18 import org.openstreetmap.josm.io.OsmApiInitializationException; 20 19 21 public class ApiPreconditionChecker implements UploadHook { 20 public class ApiPreconditionCheckerHook implements UploadHook { 22 21 23 22 public boolean checkUpload(APIDataSet apiData) {
Note:
See TracChangeset
for help on using the changeset viewer.
