Package org.openstreetmap.josm.actions
Class OpenFileAction.OpenFileTask
java.lang.Object
org.openstreetmap.josm.gui.PleaseWaitRunnable
org.openstreetmap.josm.actions.OpenFileAction.OpenFileTask
- All Implemented Interfaces:
Runnable,ProgressMonitor.CancelListener
- Enclosing class:
- OpenFileAction
Task to open files.
-
Field Summary
FieldsFields inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
progressMonitor -
Constructor Summary
ConstructorsConstructorDescriptionOpenFileTask(List<File> files, FileFilter fileFilter) Constructs a newOpenFileTask.OpenFileTask(List<File> files, FileFilter fileFilter, String title) Constructs a newOpenFileTask. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidalertFilesNotMatchingWithImporter(Collection<File> files, FileImporter importer) protected voidprotected voidcancel()User pressed cancel button.private static voidcheckNewLayers(List<Layer> oldLayers) protected voidfinish()Finish up the data work.Get the options for this taskReplies the list of files that have been successfully opened.voidimportData(FileImporter importer, List<File> files) Import data files with the given importer.booleanDetermines if filename must be saved in history (for list of recently opened files).protected voidrealRun()Called in the worker thread to do the actual work.voidsetOptions(Options... options) Set the options for the task.Methods inherited from class org.openstreetmap.josm.gui.PleaseWaitRunnable
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
-
Field Details
-
files
-
successfullyOpenedFiles
-
fileHistory
-
failedAll
-
fileFilter
-
canceled
-
options
-
-
Constructor Details
-
OpenFileTask
Constructs a newOpenFileTask.- Parameters:
files- files to openfileFilter- file filtertitle- message for the user
-
OpenFileTask
Constructs a newOpenFileTask.- Parameters:
files- files to openfileFilter- file filter
-
-
Method Details
-
setOptions
Set the options for the task.- Parameters:
options- The options to set- Since:
- 17556
- See Also:
-
isRecordHistory
Determines if filename must be saved in history (for list of recently opened files).- Returns:
trueif filename must be saved in history
-
getOptions
Get the options for this task- Returns:
- A set of options
- Since:
- 17534
-
cancel
Description copied from class:PleaseWaitRunnableUser pressed cancel button.- Specified by:
cancelin classPleaseWaitRunnable
-
finish
Description copied from class:PleaseWaitRunnableFinish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.- Specified by:
finishin classPleaseWaitRunnable
-
alertFilesNotMatchingWithImporter
-
alertFilesWithUnknownImporter
-
realRun
Description copied from class:PleaseWaitRunnableCalled 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:
realRunin classPleaseWaitRunnable- Throws:
SAXException- if a SAX error occursIOException- if an I/O error occursOsmTransferException- if a communication error with the OSM server occurs
-
checkNewLayers
-
importData
Import data files with the given importer.- Parameters:
importer- file importerfiles- data files to import
-
getSuccessfullyOpenedFiles
Replies the list of files that have been successfully opened.- Returns:
- The list of files that have been successfully opened.
-