public static class OpenFileAction.OpenFileTask extends PleaseWaitRunnable
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canceled |
private Set<String> |
failedAll |
private FileFilter |
fileFilter |
private Set<String> |
fileHistory |
private List<File> |
files |
private boolean |
recordHistory |
private List<File> |
successfullyOpenedFiles |
progressMonitor| Constructor and Description |
|---|
OpenFileTask(List<File> files,
FileFilter fileFilter)
Constructs a new
OpenFileTask. |
OpenFileTask(List<File> files,
FileFilter fileFilter,
String title)
Constructs a new
OpenFileTask. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
alertFilesNotMatchingWithImporter(Collection<File> files,
FileImporter importer) |
protected void |
alertFilesWithUnknownImporter(Collection<File> files) |
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
List<File> |
getSuccessfullyOpenedFiles()
Replies the list of files that have been successfully opened.
|
void |
importData(FileImporter importer,
List<File> files)
Import data files with the given importer.
|
boolean |
isRecordHistory()
Determines if filename must be saved in history (for list of recently opened files).
|
protected void |
realRun()
Called in the worker thread to do the actual work.
|
void |
setRecordHistory(boolean recordHistory)
Sets whether to save filename in history (for list of recently opened files).
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, runprivate final List<File> successfullyOpenedFiles
private final Set<String> fileHistory
private final FileFilter fileFilter
private boolean canceled
private boolean recordHistory
public OpenFileTask(List<File> files, FileFilter fileFilter, String title)
OpenFileTask.files - files to openfileFilter - file filtertitle - message for the userpublic OpenFileTask(List<File> files, FileFilter fileFilter)
OpenFileTask.files - files to openfileFilter - file filterpublic void setRecordHistory(boolean recordHistory)
recordHistory - true to save filename in history (default: false)public boolean isRecordHistory()
true if filename must be saved in historyprotected void cancel()
PleaseWaitRunnablecancel in class PleaseWaitRunnableprotected void finish()
PleaseWaitRunnablefinish in class PleaseWaitRunnableprotected void alertFilesNotMatchingWithImporter(Collection<File> files, FileImporter importer)
protected void alertFilesWithUnknownImporter(Collection<File> files)
protected void realRun() throws SAXException, IOException, OsmTransferException
PleaseWaitRunnablerealRun in class PleaseWaitRunnableSAXException - if a SAX error occursIOException - if an I/O error occursOsmTransferException - if a communication error with the OSM server occurspublic void importData(FileImporter importer, List<File> files)
importer - file importerfiles - data files to importpublic List<File> getSuccessfullyOpenedFiles()