Changeset 15827 in josm


Ignore:
Timestamp:
2020-02-08T16:46:49+01:00 (3 weeks ago)
Author:
Don-vip
Message:

fix EDT violation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r15784 r15827  
    4141import org.openstreetmap.josm.gui.MainApplication;
    4242import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
     43import org.openstreetmap.josm.gui.util.GuiHelper;
    4344import org.openstreetmap.josm.gui.util.WindowGeometry;
    4445import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
     
    292293     */
    293294    Collection<DownloadTask> askWhichTasksToLoad(final Collection<DownloadTask> tasks) {
    294         final JList<DownloadTask> list = new JList<>(tasks.toArray(new DownloadTask[0]));
    295         list.addSelectionInterval(0, tasks.size() - 1);
    296         final ExtendedDialog dialog = new WhichTasksToPerformDialog(list);
    297         dialog.showDialog();
    298         return dialog.getValue() == 1 ? list.getSelectedValuesList() : Collections.<DownloadTask>emptyList();
     295        return GuiHelper.runInEDTAndWaitAndReturn(() -> {
     296            final JList<DownloadTask> list = new JList<>(tasks.toArray(new DownloadTask[0]));
     297            list.addSelectionInterval(0, tasks.size() - 1);
     298            final ExtendedDialog dialog = new WhichTasksToPerformDialog(list);
     299            dialog.showDialog();
     300            return dialog.getValue() == 1 ? list.getSelectedValuesList() : Collections.<DownloadTask>emptyList();
     301        });
    299302    }
    300303
Note: See TracChangeset for help on using the changeset viewer.