Class OpenFileAction.OpenFileTask

    • Field Detail

      • files

        private final java.util.List<java.io.File> files
      • fileHistory

        private final java.util.Set<java.lang.String> fileHistory
      • failedAll

        private final java.util.Set<java.lang.String> failedAll
      • fileFilter

        private final javax.swing.filechooser.FileFilter fileFilter
    • Constructor Detail

      • OpenFileTask

        public OpenFileTask​(java.util.List<java.io.File> files,
                            javax.swing.filechooser.FileFilter fileFilter,
                            java.lang.String title)
        Constructs a new OpenFileTask.
        Parameters:
        files - files to open
        fileFilter - file filter
        title - message for the user
      • OpenFileTask

        public OpenFileTask​(java.util.List<java.io.File> files,
                            javax.swing.filechooser.FileFilter fileFilter)
        Constructs a new OpenFileTask.
        Parameters:
        files - files to open
        fileFilter - file filter
    • Method Detail

      • setOptions

        public void setOptions​(Options... options)
        Set the options for the task.
        Parameters:
        options - The options to set
        Since:
        17556
        See Also:
        Options
      • isRecordHistory

        public boolean isRecordHistory()
        Determines if filename must be saved in history (for list of recently opened files).
        Returns:
        true if filename must be saved in history
      • getOptions

        public java.util.Set<OptionsgetOptions()
        Get the options for this task
        Returns:
        A set of options
        Since:
        17534
      • finish

        protected void finish()
        Description copied from class: PleaseWaitRunnable
        Finish 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:
        finish in class PleaseWaitRunnable
      • 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 class PleaseWaitRunnable
        Throws:
        org.xml.sax.SAXException - if a SAX error occurs
        java.io.IOException - if an I/O error occurs
        OsmTransferException - if a communication error with the OSM server occurs
      • importData

        public void importData​(FileImporter importer,
                               java.util.List<java.io.File> files)
        Import data files with the given importer.
        Parameters:
        importer - file importer
        files - data files to import
      • getSuccessfullyOpenedFiles

        public java.util.List<java.io.File> getSuccessfullyOpenedFiles()
        Replies the list of files that have been successfully opened.
        Returns:
        The list of files that have been successfully opened.