Ignore:
Timestamp:
2010-11-29T08:24:10+01:00 (13 years ago)
Author:
bastiK
Message:

see #5559 - ExtendedDialog.showDialog() blocks when called in main thread, so move gui stuff to edt. This problem is highly system dependent (i could never reproduce it myself, but seems to be quite common)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/FileImporter.java

    r3501 r3679  
    3636    /**
    3737     * Needs to be implemented if isBatchImporter() returns false.
    38      * @throws IllegalDataException
    3938     */
    4039    public void importData(File file, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
     
    4443    /**
    4544     * Needs to be implemented if isBatchImporter() returns true.
    46      * @throws IllegalDataException
    4745     */
    4846    public void importData(List<File> files, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
     
    5250    /**
    5351     * Wrapper to give meaningful output if things go wrong.
     52     * @return true if data import was successful
    5453     */
    55     public void importDataHandleExceptions(File f, ProgressMonitor progressMonitor) {
     54    public boolean importDataHandleExceptions(File f, ProgressMonitor progressMonitor) {
    5655        try {
    5756            System.out.println("Open file: " + f.getAbsolutePath() + " (" + f.length() + " bytes)");
    5857            importData(f, progressMonitor);
     58            return true;
    5959        } catch (Exception e) {
    6060            e.printStackTrace();
     
    6565                    JOptionPane.ERROR_MESSAGE, null
    6666            );
     67            return false;
    6768        }
    6869    }
    69     public void importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
     70    public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
    7071        try {
    7172            System.out.println("Open "+files.size()+" files");
    7273            importData(files, progressMonitor);
     74            return true;
    7375        } catch (Exception e) {
    7476            e.printStackTrace();
     
    7981                    JOptionPane.ERROR_MESSAGE, null
    8082            );
     83            return false;
    8184        }
    8285    }
Note: See TracChangeset for help on using the changeset viewer.