Package org.openstreetmap.josm.gui.dialogs.changeset

Examples of org.openstreetmap.josm.gui.dialogs.changeset.ChangesetHeaderDownloadTask


        public void actionPerformed(ActionEvent arg0) {
            ChangesetListModel model = getCurrentChangesetListModel();
            Set<Integer> sel = model.getSelectedChangesetIds();
            if (sel.isEmpty())
                return;
            ChangesetHeaderDownloadTask task = new ChangesetHeaderDownloadTask(sel);
            Main.worker.submit(task);
        }
View Full Code Here


                if (!cc.contains(id)) {
                    toDownload.add(id);
                }
            }

            final ChangesetHeaderDownloadTask task;
            final Future<?> future;
            if (toDownload.isEmpty()) {
                task = null;
                future = null;
            } else {
                task = new ChangesetHeaderDownloadTask(toDownload);
                future = Main.worker.submit(task);
            }

            Runnable r = new Runnable() {
                @Override
                public void run() {
                    // first, wait for the download task to finish, if a download
                    // task was launched
                    if (future != null) {
                        try {
                            future.get();
                        } catch(InterruptedException e) {
                            Main.warn("InterruptedException in "+getClass().getSimpleName()+" while downloading changeset header");
                        } catch(ExecutionException e) {
                            Main.error(e);
                            BugReportExceptionHandler.handleException(e.getCause());
                            return;
                        }
                    }
                    if (task != null) {
                        if (task.isCanceled())
                            // don't launch the changeset manager if the download task
                            // was canceled
                            return;
                        if (task.isFailed()) {
                            toDownload.clear();
                        }
                    }
                    // launch the task
                    launchChangesetManager(toDownload);
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.gui.dialogs.changeset.ChangesetHeaderDownloadTask

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.