Class UploadNotesTask.UploadTask
- java.lang.Object
-
- org.openstreetmap.josm.gui.PleaseWaitRunnable
-
- org.openstreetmap.josm.actions.upload.UploadNotesTask.UploadTask
-
- All Implemented Interfaces:
java.lang.Runnable
,ProgressMonitor.CancelListener
- Enclosing class:
- UploadNotesTask
private class UploadNotesTask.UploadTask extends PleaseWaitRunnable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Note,java.lang.Exception>
failedNotes
private boolean
isCanceled
private java.util.Map<Note,Note>
updatedNotes
-
Fields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor
-
-
Constructor Summary
Constructors Constructor Description UploadTask(java.lang.String title, ProgressMonitor monitor)
Constructs a newUploadTask
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancel()
User pressed cancel button.protected void
finish()
Updates the note layer with uploaded notes and notifies the user of any upload failuresprivate void
processNoteComment(ProgressMonitor monitor, OsmApi api, Note note, NoteComment comment)
protected void
realRun()
Called in the worker thread to do the actual work.-
Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
-
-
-
Field Detail
-
isCanceled
private boolean isCanceled
-
updatedNotes
private final java.util.Map<Note,Note> updatedNotes
-
failedNotes
private final java.util.Map<Note,java.lang.Exception> failedNotes
-
-
Constructor Detail
-
UploadTask
UploadTask(java.lang.String title, ProgressMonitor monitor)
Constructs a newUploadTask
.- Parameters:
title
- message for the usermonitor
- progress monitor
-
-
Method Detail
-
cancel
protected void cancel()
Description copied from class:PleaseWaitRunnable
User pressed cancel button.- Specified by:
cancel
in classPleaseWaitRunnable
-
realRun
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
Description copied from class:PleaseWaitRunnable
Called in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.- Specified by:
realRun
in classPleaseWaitRunnable
- Throws:
org.xml.sax.SAXException
- if a SAX error occursjava.io.IOException
- if an I/O error occursOsmTransferException
- if a communication error with the OSM server occurs
-
processNoteComment
private void processNoteComment(ProgressMonitor monitor, OsmApi api, Note note, NoteComment comment)
-
finish
protected void finish()
Updates the note layer with uploaded notes and notifies the user of any upload failures- Specified by:
finish
in classPleaseWaitRunnable
-
-