Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12675)
@@ -91,5 +91,5 @@
 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder;
 import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
-import org.openstreetmap.josm.gui.progress.ProgressMonitorExecutor;
+import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor;
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
 import org.openstreetmap.josm.gui.util.GuiHelper;
Index: trunk/src/org/openstreetmap/josm/gui/MainPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainPanel.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/MainPanel.java	(revision 12675)
@@ -14,5 +14,5 @@
 import org.openstreetmap.josm.gui.layer.MainLayerManager.LayerAvailabilityEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.LayerAvailabilityListener;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 12675)
@@ -71,6 +71,6 @@
 import org.openstreetmap.josm.data.preferences.DoubleProperty;
 import org.openstreetmap.josm.gui.help.Helpful;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor.ProgressMonitorDialog;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.ImageLabel;
Index: trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java	(revision 12675)
@@ -21,5 +21,5 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor.ProgressMonitorDialog;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.JosmTextArea;
Index: trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 12675)
@@ -9,7 +9,7 @@
 import javax.swing.SwingUtilities;
 
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor.CancelListener;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressTaskId;
 import org.openstreetmap.josm.io.OsmTransferException;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java	(revision 12675)
@@ -39,6 +39,6 @@
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmApiException;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java	(revision 12675)
@@ -21,6 +21,6 @@
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.io.MultiFetchServerObjectReader;
 import org.openstreetmap.josm.io.OsmTransferException;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java	(revision 12675)
@@ -18,5 +18,5 @@
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmServerBackreferenceReader;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java	(revision 12675)
@@ -26,5 +26,5 @@
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.tools.ImageProvider;
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 12675)
@@ -21,6 +21,6 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.io.OsmServerObjectReader;
Index: trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/io/AbstractPrimitiveTask.java	(revision 12675)
@@ -18,6 +18,6 @@
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.MultiFetchServerObjectReader;
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 12675)
@@ -50,5 +50,5 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.gui.progress.SwingRenderingProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.SwingRenderingProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.GBC;
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 12675)
@@ -99,6 +99,6 @@
 import org.openstreetmap.josm.gui.io.importexport.OsmImporter;
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
-import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.FileChooserManager;
Index: trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java	(revision 12675)
@@ -27,8 +27,16 @@
     private final CancelHandler cancelHandler;
 
-    protected enum State {
+    /**
+     * Progress monitor state
+     * @since 12675 (visibility)
+     */
+    public enum State {
+        /** Initialization. Next valid states are {@link #IN_TASK} or {@link #FINISHED} */
         INIT,
+        /** In task. Next valid states are {@link #IN_SUBTASK} or {@link #FINISHED} */
         IN_TASK,
+        /** In subtask. Next valid states is {@link #IN_TASK} */
         IN_SUBTASK,
+        /** Finished. Can't change state after that */
         FINISHED
     }
Index: trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java	(revision 12674)
+++ 	(revision )
@@ -1,410 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.progress;
-
-import java.awt.Component;
-import java.awt.GraphicsEnvironment;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.SwingUtilities;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.MapFrame;
-import org.openstreetmap.josm.gui.MapStatus.BackgroundProgressMonitor;
-import org.openstreetmap.josm.gui.PleaseWaitDialog;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.tools.bugreport.BugReport;
-
-/**
- * A progress monitor used in {@link org.openstreetmap.josm.gui.PleaseWaitRunnable}.
- * <p>
- * Progress is displayed in a dialog window ({@link PleaseWaitDialog}).
- */
-public class PleaseWaitProgressMonitor extends AbstractProgressMonitor {
-
-    /**
-     * Implemented by both foreground dialog and background progress dialog (in status bar)
-     */
-    public interface ProgressMonitorDialog {
-        /**
-         * Sets the visibility of this dialog
-         * @param visible The visibility, <code>true</code> to show it, <code>false</code> to hide it
-         */
-        void setVisible(boolean visible);
-
-        /**
-         * Updates the progress value to the specified progress.
-         * @param progress The progress as integer. Between 0 and {@link PleaseWaitProgressMonitor#PROGRESS_BAR_MAX}
-         */
-        void updateProgress(int progress);
-
-        /**
-         * Sets the description of what is done
-         * @param text The description of the task
-         */
-        void setCustomText(String text);
-
-        /**
-         * Sets the current action that is done
-         * @param text The current action
-         */
-        void setCurrentAction(String text);
-
-        /**
-         * Display that the current progress cannot be determined
-         * @param newValue wether the progress cannot be determined
-         */
-        void setIndeterminate(boolean newValue);
-
-        /**
-         * Append a message to the progress log
-         * <p>
-         * TODO Not implemented properly in background monitor, log message will get lost if progress runs in background
-         * @param message The message
-         */
-        void appendLogMessage(String message);
-    }
-
-    /**
-     * The maximum value the progress bar that displays the current progress should have.
-     */
-    public static final int PROGRESS_BAR_MAX = 10_000;
-
-    /**
-     * The progress monitor being currently displayed.
-     */
-    static PleaseWaitProgressMonitor currentProgressMonitor;
-
-    private final Component dialogParent;
-
-    private int currentProgressValue;
-    private String customText;
-    private String title;
-    private boolean indeterminate;
-
-    private boolean isInBackground;
-    private PleaseWaitDialog dialog;
-    private String windowTitle;
-    protected ProgressTaskId taskId;
-
-    private boolean cancelable;
-
-    /**
-     * Returns the progress monitor being currently displayed.
-     * @return the progress monitor being currently displayed
-     * @since 12638
-     */
-    public static PleaseWaitProgressMonitor getCurrent() {
-        return currentProgressMonitor;
-    }
-
-    private void doInEDT(Runnable runnable) {
-        // This must be invoke later even if current thread is EDT because inside there is dialog.setVisible
-        // which freeze current code flow until modal dialog is closed
-        SwingUtilities.invokeLater(() -> {
-            try {
-                runnable.run();
-            } catch (RuntimeException e) { // NOPMD
-                throw BugReport.intercept(e).put("monitor", this);
-            }
-        });
-    }
-
-    private void setDialogVisible(boolean visible) {
-        if (dialog.isVisible() != visible) {
-            dialog.setVisible(visible);
-        }
-    }
-
-    private ProgressMonitorDialog getDialog() {
-
-        BackgroundProgressMonitor backgroundMonitor = null;
-        MapFrame map = MainApplication.getMap();
-        if (map != null) {
-            backgroundMonitor = map.statusLine.progressMonitor;
-        }
-
-        if (backgroundMonitor != null) {
-            backgroundMonitor.setVisible(isInBackground);
-        }
-        if (dialog != null) {
-            setDialogVisible(!isInBackground || backgroundMonitor == null);
-        }
-
-        if (isInBackground && backgroundMonitor != null) {
-            backgroundMonitor.setVisible(true);
-            if (dialog != null) {
-                setDialogVisible(false);
-            }
-            return backgroundMonitor;
-        } else if (backgroundMonitor != null) {
-            backgroundMonitor.setVisible(false);
-            if (dialog != null) {
-                setDialogVisible(true);
-            }
-            return dialog;
-        } else if (dialog != null) {
-            setDialogVisible(true);
-            return dialog;
-        } else
-            return null;
-    }
-
-    /**
-     * Constructs a new {@code PleaseWaitProgressMonitor}.
-     */
-    public PleaseWaitProgressMonitor() {
-        this("");
-    }
-
-    /**
-     * Constructs a new {@code PleaseWaitProgressMonitor}.
-     * @param windowTitle window title
-     */
-    public PleaseWaitProgressMonitor(String windowTitle) {
-        this(Main.parent);
-        this.windowTitle = windowTitle;
-    }
-
-    /**
-     * Constructs a new {@code PleaseWaitProgressMonitor}.
-     * @param dialogParent component to get parent frame from
-     */
-    public PleaseWaitProgressMonitor(Component dialogParent) {
-        super(new CancelHandler());
-        if (GraphicsEnvironment.isHeadless()) {
-            this.dialogParent = dialogParent;
-        } else {
-            this.dialogParent = GuiHelper.getFrameForComponent(dialogParent);
-        }
-        this.cancelable = true;
-    }
-
-    /**
-     * Constructs a new {@code PleaseWaitProgressMonitor}.
-     * @param dialogParent component to get parent frame from
-     * @param windowTitle window title
-     */
-    public PleaseWaitProgressMonitor(Component dialogParent, String windowTitle) {
-        this(GuiHelper.getFrameForComponent(dialogParent));
-        this.windowTitle = windowTitle;
-    }
-
-    private final ActionListener cancelListener = e -> cancel();
-
-    private final ActionListener inBackgroundListener = e -> {
-        isInBackground = true;
-        ProgressMonitorDialog dlg = getDialog();
-        if (dlg != null) {
-            reset();
-            dlg.setVisible(true);
-        }
-    };
-
-    private final WindowListener windowListener = new WindowAdapter() {
-        @Override public void windowClosing(WindowEvent e) {
-            cancel();
-        }
-    };
-
-    /**
-     * See if this task is canceleable
-     * @return <code>true</code> if it can be canceled
-     */
-    public final boolean isCancelable() {
-        return cancelable;
-    }
-
-    /**
-     * Sets this task to be cancelable
-     * @param cancelable Whether it can be canceled
-     */
-    public final void setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
-    }
-
-    @Override
-    public void doBeginTask() {
-        doInEDT(() -> {
-            currentProgressMonitor = this;
-            if (GraphicsEnvironment.isHeadless()) {
-                return;
-            }
-            if (dialogParent != null && dialog == null) {
-                dialog = new PleaseWaitDialog(dialogParent);
-            } else {
-                throw new ProgressException("PleaseWaitDialog parent must be set");
-            }
-
-            if (windowTitle != null) {
-                dialog.setTitle(windowTitle);
-            }
-            dialog.setCancelEnabled(cancelable);
-            dialog.setCancelCallback(cancelListener);
-            dialog.setInBackgroundCallback(inBackgroundListener);
-            dialog.setCustomText("");
-            dialog.addWindowListener(windowListener);
-            dialog.setMaximumProgress(PROGRESS_BAR_MAX);
-            dialog.setVisible(true);
-        });
-    }
-
-    @Override
-    public void doFinishTask() {
-        // do nothing
-    }
-
-    @Override
-    protected void updateProgress(double progressValue) {
-        final int newValue = (int) (progressValue * PROGRESS_BAR_MAX);
-        if (newValue != currentProgressValue) {
-            currentProgressValue = newValue;
-            doInEDT(() -> {
-                ProgressMonitorDialog dlg = getDialog();
-                if (dlg != null) {
-                    dlg.updateProgress(currentProgressValue);
-                }
-            });
-        }
-    }
-
-    @Override
-    protected void doSetCustomText(final String title) {
-        checkState(State.IN_TASK, State.IN_SUBTASK);
-        this.customText = title;
-        doInEDT(() -> {
-            ProgressMonitorDialog dlg = getDialog();
-            if (dlg != null) {
-                dlg.setCustomText(title);
-            }
-        });
-    }
-
-    @Override
-    protected void doSetTitle(final String title) {
-        checkState(State.IN_TASK, State.IN_SUBTASK);
-        this.title = title;
-        doInEDT(() -> {
-            ProgressMonitorDialog dlg = getDialog();
-            if (dlg != null) {
-                dlg.setCurrentAction(title);
-            }
-        });
-    }
-
-    @Override
-    protected void doSetIntermediate(final boolean value) {
-        this.indeterminate = value;
-        doInEDT(() -> {
-            // Enable only if progress is at the beginning. Doing intermediate progress in the middle
-            // will hide already reached progress
-            ProgressMonitorDialog dlg = getDialog();
-            if (dlg != null) {
-                dlg.setIndeterminate(value && currentProgressValue == 0);
-            }
-        });
-    }
-
-    @Override
-    public void appendLogMessage(final String message) {
-        doInEDT(() -> {
-            ProgressMonitorDialog dlg = getDialog();
-            if (dlg != null) {
-                dlg.appendLogMessage(message);
-            }
-        });
-    }
-
-    /**
-     * Update the dialog values
-     */
-    public void reset() {
-        if (dialog != null) {
-            dialog.setTitle(title);
-            dialog.setCustomText(customText);
-            dialog.updateProgress(currentProgressValue);
-            dialog.setIndeterminate(indeterminate && currentProgressValue == 0);
-        }
-        BackgroundProgressMonitor backgroundMonitor = null;
-        MapFrame map = MainApplication.getMap();
-        if (map != null) {
-            backgroundMonitor = map.statusLine.progressMonitor;
-        }
-        if (backgroundMonitor != null) {
-            backgroundMonitor.setCurrentAction(title);
-            backgroundMonitor.setCustomText(customText);
-            backgroundMonitor.updateProgress(currentProgressValue);
-            backgroundMonitor.setIndeterminate(indeterminate && currentProgressValue == 0);
-        }
-    }
-
-    /**
-     * Close the progress dialog window.
-     */
-    public void close() {
-        doInEDT(() -> {
-            if (dialog != null) {
-                dialog.setVisible(false);
-                dialog.setCancelCallback(null);
-                dialog.setInBackgroundCallback(null);
-                dialog.removeWindowListener(windowListener);
-                dialog.dispose();
-                dialog = null;
-                currentProgressMonitor = null;
-                MapFrame map = MainApplication.getMap();
-                if (map != null) {
-                    map.statusLine.progressMonitor.setVisible(false);
-                }
-            }
-        });
-    }
-
-    /**
-     * Show the progress dialog in foreground
-     */
-    public void showForegroundDialog() {
-        isInBackground = false;
-        doInEDT(() -> {
-            if (dialog != null) {
-                dialog.setInBackgroundPossible(taskId != null && MainApplication.isDisplayingMapView());
-                reset();
-                getDialog();
-            }
-        });
-    }
-
-    @Override
-    public void setProgressTaskId(ProgressTaskId taskId) {
-        this.taskId = taskId;
-        doInEDT(() -> {
-            if (dialog != null) {
-                dialog.setInBackgroundPossible(taskId != null && MainApplication.isDisplayingMapView());
-            }
-        });
-    }
-
-    @Override
-    public ProgressTaskId getProgressTaskId() {
-        return taskId;
-    }
-
-    @Override
-    public Component getWindowParent() {
-        Component parent = dialog;
-        if (isInBackground || parent == null)
-            return Main.parent;
-        else
-            return parent;
-    }
-
-    @Override
-    public String toString() {
-        return "PleaseWaitProgressMonitor [currentProgressValue=" + currentProgressValue + ", customText=" + customText
-                + ", title=" + title + ", indeterminate=" + indeterminate + ", isInBackground=" + isInBackground
-                + ", windowTitle=" + windowTitle + ", taskId=" + taskId + ", cancelable=" + cancelable + ", state="
-                + state + "]";
-    }
-}
Index: trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitorExecutor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitorExecutor.java	(revision 12674)
+++ 	(revision )
@@ -1,38 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.progress;
-
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import org.openstreetmap.josm.tools.Utils;
-
-/**
- * Executor that displays the progress monitor to the user.
- *
- * Similar to Executors.newSingleThreadExecutor(), but displays the
- * progress monitor whenever a new task is executed.
- */
-public class ProgressMonitorExecutor extends ThreadPoolExecutor {
-
-    /**
-     * Creates a new {@code ProgressMonitorExecutor}
-     * @param nameFormat see {@link Utils#newThreadFactory(String, int)}
-     * @param threadPriority see {@link Utils#newThreadFactory(String, int)}
-     */
-    public ProgressMonitorExecutor(final String nameFormat, final int threadPriority) {
-        super(1, 1, 0L, TimeUnit.MILLISECONDS,
-                new LinkedBlockingQueue<Runnable>(),
-                Utils.newThreadFactory(nameFormat, threadPriority));
-    }
-
-    @Override
-    public void execute(Runnable command) {
-        if (PleaseWaitProgressMonitor.currentProgressMonitor != null) {
-            //TODO show only if this can't be in background or better if always in background is not checked
-            PleaseWaitProgressMonitor.currentProgressMonitor.showForegroundDialog();
-        }
-        super.execute(command);
-    }
-
-}
Index: trunk/src/org/openstreetmap/josm/gui/progress/ProgressRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/ProgressRenderer.java	(revision 12674)
+++ trunk/src/org/openstreetmap/josm/gui/progress/ProgressRenderer.java	(revision 12675)
@@ -1,4 +1,6 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.gui.progress;
+
+import org.openstreetmap.josm.gui.progress.swing.SwingRenderingProgressMonitor;
 
 /**
Index: trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java	(revision 12674)
+++ 	(revision )
@@ -1,85 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.progress;
-
-import java.awt.Component;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.tools.CheckParameterUtil;
-
-/**
- * SwingRenderingProgressMonitor is progress monitor which delegates the rendering
- * of progress information to a {@link ProgressRenderer}.
- * Methods of the progress renderer are always called on the Swing EDT.
- *
- */
-public class SwingRenderingProgressMonitor extends AbstractProgressMonitor {
-    private static final int PROGRESS_BAR_MAX = 100;
-    private int currentProgressValue;
-    private final ProgressRenderer delegate;
-
-    /**
-     *
-     * @param delegate the delegate which renders the progress information. Must not be null.
-     * @throws IllegalArgumentException if delegate is null
-     */
-    public SwingRenderingProgressMonitor(ProgressRenderer delegate) {
-        super(new CancelHandler());
-        CheckParameterUtil.ensureParameterNotNull(delegate, "delegate");
-        this.delegate = delegate;
-    }
-
-    @Override
-    public void doBeginTask() {
-        GuiHelper.runInEDT(() -> {
-            delegate.setCustomText("");
-            delegate.setMaximum(PROGRESS_BAR_MAX);
-        });
-    }
-
-    @Override
-    public void doFinishTask() {
-        // do nothing
-    }
-
-    @Override
-    protected void updateProgress(double progressValue) {
-        final int newValue = (int) (progressValue * PROGRESS_BAR_MAX);
-        if (newValue != currentProgressValue) {
-            currentProgressValue = newValue;
-            GuiHelper.runInEDT(() -> delegate.setValue(currentProgressValue));
-        }
-    }
-
-    @Override
-    protected void doSetCustomText(final String title) {
-        checkState(State.IN_TASK, State.IN_SUBTASK);
-        GuiHelper.runInEDT(() -> delegate.setCustomText(title));
-    }
-
-    @Override
-    protected void doSetTitle(final String title) {
-        checkState(State.IN_TASK, State.IN_SUBTASK);
-        GuiHelper.runInEDT(() -> delegate.setTaskTitle(title));
-    }
-
-    @Override
-    protected void doSetIntermediate(final boolean value) {
-        GuiHelper.runInEDT(() -> delegate.setIndeterminate(value));
-    }
-
-    @Override
-    public void setProgressTaskId(ProgressTaskId taskId) {
-        // Do nothing
-    }
-
-    @Override
-    public ProgressTaskId getProgressTaskId() {
-        return null;
-    }
-
-    @Override
-    public Component getWindowParent() {
-        return Main.parent;
-    }
-}
Index: trunk/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java	(revision 12675)
+++ trunk/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java	(revision 12675)
@@ -0,0 +1,415 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.progress.swing;
+
+import java.awt.Component;
+import java.awt.GraphicsEnvironment;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+
+import javax.swing.SwingUtilities;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapStatus.BackgroundProgressMonitor;
+import org.openstreetmap.josm.gui.PleaseWaitDialog;
+import org.openstreetmap.josm.gui.progress.AbstractProgressMonitor;
+import org.openstreetmap.josm.gui.progress.CancelHandler;
+import org.openstreetmap.josm.gui.progress.ProgressException;
+import org.openstreetmap.josm.gui.progress.ProgressTaskId;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.bugreport.BugReport;
+
+/**
+ * A progress monitor used in {@link org.openstreetmap.josm.gui.PleaseWaitRunnable}.
+ * <p>
+ * Progress is displayed in a dialog window ({@link PleaseWaitDialog}).
+ * @since 12675 (moved from {@code gui.progress} package}
+ */
+public class PleaseWaitProgressMonitor extends AbstractProgressMonitor {
+
+    /**
+     * Implemented by both foreground dialog and background progress dialog (in status bar)
+     */
+    public interface ProgressMonitorDialog {
+        /**
+         * Sets the visibility of this dialog
+         * @param visible The visibility, <code>true</code> to show it, <code>false</code> to hide it
+         */
+        void setVisible(boolean visible);
+
+        /**
+         * Updates the progress value to the specified progress.
+         * @param progress The progress as integer. Between 0 and {@link PleaseWaitProgressMonitor#PROGRESS_BAR_MAX}
+         */
+        void updateProgress(int progress);
+
+        /**
+         * Sets the description of what is done
+         * @param text The description of the task
+         */
+        void setCustomText(String text);
+
+        /**
+         * Sets the current action that is done
+         * @param text The current action
+         */
+        void setCurrentAction(String text);
+
+        /**
+         * Display that the current progress cannot be determined
+         * @param newValue wether the progress cannot be determined
+         */
+        void setIndeterminate(boolean newValue);
+
+        /**
+         * Append a message to the progress log
+         * <p>
+         * TODO Not implemented properly in background monitor, log message will get lost if progress runs in background
+         * @param message The message
+         */
+        void appendLogMessage(String message);
+    }
+
+    /**
+     * The maximum value the progress bar that displays the current progress should have.
+     */
+    public static final int PROGRESS_BAR_MAX = 10_000;
+
+    /**
+     * The progress monitor being currently displayed.
+     */
+    static PleaseWaitProgressMonitor currentProgressMonitor;
+
+    private final Component dialogParent;
+
+    private int currentProgressValue;
+    private String customText;
+    private String title;
+    private boolean indeterminate;
+
+    private boolean isInBackground;
+    private PleaseWaitDialog dialog;
+    private String windowTitle;
+    protected ProgressTaskId taskId;
+
+    private boolean cancelable;
+
+    /**
+     * Returns the progress monitor being currently displayed.
+     * @return the progress monitor being currently displayed
+     * @since 12638
+     */
+    public static PleaseWaitProgressMonitor getCurrent() {
+        return currentProgressMonitor;
+    }
+
+    private void doInEDT(Runnable runnable) {
+        // This must be invoke later even if current thread is EDT because inside there is dialog.setVisible
+        // which freeze current code flow until modal dialog is closed
+        SwingUtilities.invokeLater(() -> {
+            try {
+                runnable.run();
+            } catch (RuntimeException e) { // NOPMD
+                throw BugReport.intercept(e).put("monitor", this);
+            }
+        });
+    }
+
+    private void setDialogVisible(boolean visible) {
+        if (dialog.isVisible() != visible) {
+            dialog.setVisible(visible);
+        }
+    }
+
+    private ProgressMonitorDialog getDialog() {
+
+        BackgroundProgressMonitor backgroundMonitor = null;
+        MapFrame map = MainApplication.getMap();
+        if (map != null) {
+            backgroundMonitor = map.statusLine.progressMonitor;
+        }
+
+        if (backgroundMonitor != null) {
+            backgroundMonitor.setVisible(isInBackground);
+        }
+        if (dialog != null) {
+            setDialogVisible(!isInBackground || backgroundMonitor == null);
+        }
+
+        if (isInBackground && backgroundMonitor != null) {
+            backgroundMonitor.setVisible(true);
+            if (dialog != null) {
+                setDialogVisible(false);
+            }
+            return backgroundMonitor;
+        } else if (backgroundMonitor != null) {
+            backgroundMonitor.setVisible(false);
+            if (dialog != null) {
+                setDialogVisible(true);
+            }
+            return dialog;
+        } else if (dialog != null) {
+            setDialogVisible(true);
+            return dialog;
+        } else
+            return null;
+    }
+
+    /**
+     * Constructs a new {@code PleaseWaitProgressMonitor}.
+     */
+    public PleaseWaitProgressMonitor() {
+        this("");
+    }
+
+    /**
+     * Constructs a new {@code PleaseWaitProgressMonitor}.
+     * @param windowTitle window title
+     */
+    public PleaseWaitProgressMonitor(String windowTitle) {
+        this(Main.parent);
+        this.windowTitle = windowTitle;
+    }
+
+    /**
+     * Constructs a new {@code PleaseWaitProgressMonitor}.
+     * @param dialogParent component to get parent frame from
+     */
+    public PleaseWaitProgressMonitor(Component dialogParent) {
+        super(new CancelHandler());
+        if (GraphicsEnvironment.isHeadless()) {
+            this.dialogParent = dialogParent;
+        } else {
+            this.dialogParent = GuiHelper.getFrameForComponent(dialogParent);
+        }
+        this.cancelable = true;
+    }
+
+    /**
+     * Constructs a new {@code PleaseWaitProgressMonitor}.
+     * @param dialogParent component to get parent frame from
+     * @param windowTitle window title
+     */
+    public PleaseWaitProgressMonitor(Component dialogParent, String windowTitle) {
+        this(GuiHelper.getFrameForComponent(dialogParent));
+        this.windowTitle = windowTitle;
+    }
+
+    private final ActionListener cancelListener = e -> cancel();
+
+    private final ActionListener inBackgroundListener = e -> {
+        isInBackground = true;
+        ProgressMonitorDialog dlg = getDialog();
+        if (dlg != null) {
+            reset();
+            dlg.setVisible(true);
+        }
+    };
+
+    private final WindowListener windowListener = new WindowAdapter() {
+        @Override public void windowClosing(WindowEvent e) {
+            cancel();
+        }
+    };
+
+    /**
+     * See if this task is canceleable
+     * @return <code>true</code> if it can be canceled
+     */
+    public final boolean isCancelable() {
+        return cancelable;
+    }
+
+    /**
+     * Sets this task to be cancelable
+     * @param cancelable Whether it can be canceled
+     */
+    public final void setCancelable(boolean cancelable) {
+        this.cancelable = cancelable;
+    }
+
+    @Override
+    public void doBeginTask() {
+        doInEDT(() -> {
+            currentProgressMonitor = this;
+            if (GraphicsEnvironment.isHeadless()) {
+                return;
+            }
+            if (dialogParent != null && dialog == null) {
+                dialog = new PleaseWaitDialog(dialogParent);
+            } else {
+                throw new ProgressException("PleaseWaitDialog parent must be set");
+            }
+
+            if (windowTitle != null) {
+                dialog.setTitle(windowTitle);
+            }
+            dialog.setCancelEnabled(cancelable);
+            dialog.setCancelCallback(cancelListener);
+            dialog.setInBackgroundCallback(inBackgroundListener);
+            dialog.setCustomText("");
+            dialog.addWindowListener(windowListener);
+            dialog.setMaximumProgress(PROGRESS_BAR_MAX);
+            dialog.setVisible(true);
+        });
+    }
+
+    @Override
+    public void doFinishTask() {
+        // do nothing
+    }
+
+    @Override
+    protected void updateProgress(double progressValue) {
+        final int newValue = (int) (progressValue * PROGRESS_BAR_MAX);
+        if (newValue != currentProgressValue) {
+            currentProgressValue = newValue;
+            doInEDT(() -> {
+                ProgressMonitorDialog dlg = getDialog();
+                if (dlg != null) {
+                    dlg.updateProgress(currentProgressValue);
+                }
+            });
+        }
+    }
+
+    @Override
+    protected void doSetCustomText(final String title) {
+        checkState(State.IN_TASK, State.IN_SUBTASK);
+        this.customText = title;
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setCustomText(title);
+            }
+        });
+    }
+
+    @Override
+    protected void doSetTitle(final String title) {
+        checkState(State.IN_TASK, State.IN_SUBTASK);
+        this.title = title;
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setCurrentAction(title);
+            }
+        });
+    }
+
+    @Override
+    protected void doSetIntermediate(final boolean value) {
+        this.indeterminate = value;
+        doInEDT(() -> {
+            // Enable only if progress is at the beginning. Doing intermediate progress in the middle
+            // will hide already reached progress
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.setIndeterminate(value && currentProgressValue == 0);
+            }
+        });
+    }
+
+    @Override
+    public void appendLogMessage(final String message) {
+        doInEDT(() -> {
+            ProgressMonitorDialog dlg = getDialog();
+            if (dlg != null) {
+                dlg.appendLogMessage(message);
+            }
+        });
+    }
+
+    /**
+     * Update the dialog values
+     */
+    public void reset() {
+        if (dialog != null) {
+            dialog.setTitle(title);
+            dialog.setCustomText(customText);
+            dialog.updateProgress(currentProgressValue);
+            dialog.setIndeterminate(indeterminate && currentProgressValue == 0);
+        }
+        BackgroundProgressMonitor backgroundMonitor = null;
+        MapFrame map = MainApplication.getMap();
+        if (map != null) {
+            backgroundMonitor = map.statusLine.progressMonitor;
+        }
+        if (backgroundMonitor != null) {
+            backgroundMonitor.setCurrentAction(title);
+            backgroundMonitor.setCustomText(customText);
+            backgroundMonitor.updateProgress(currentProgressValue);
+            backgroundMonitor.setIndeterminate(indeterminate && currentProgressValue == 0);
+        }
+    }
+
+    /**
+     * Close the progress dialog window.
+     */
+    public void close() {
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setVisible(false);
+                dialog.setCancelCallback(null);
+                dialog.setInBackgroundCallback(null);
+                dialog.removeWindowListener(windowListener);
+                dialog.dispose();
+                dialog = null;
+                currentProgressMonitor = null;
+                MapFrame map = MainApplication.getMap();
+                if (map != null) {
+                    map.statusLine.progressMonitor.setVisible(false);
+                }
+            }
+        });
+    }
+
+    /**
+     * Show the progress dialog in foreground
+     */
+    public void showForegroundDialog() {
+        isInBackground = false;
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setInBackgroundPossible(taskId != null && MainApplication.isDisplayingMapView());
+                reset();
+                getDialog();
+            }
+        });
+    }
+
+    @Override
+    public void setProgressTaskId(ProgressTaskId taskId) {
+        this.taskId = taskId;
+        doInEDT(() -> {
+            if (dialog != null) {
+                dialog.setInBackgroundPossible(taskId != null && MainApplication.isDisplayingMapView());
+            }
+        });
+    }
+
+    @Override
+    public ProgressTaskId getProgressTaskId() {
+        return taskId;
+    }
+
+    @Override
+    public Component getWindowParent() {
+        Component parent = dialog;
+        if (isInBackground || parent == null)
+            return Main.parent;
+        else
+            return parent;
+    }
+
+    @Override
+    public String toString() {
+        return "PleaseWaitProgressMonitor [currentProgressValue=" + currentProgressValue + ", customText=" + customText
+                + ", title=" + title + ", indeterminate=" + indeterminate + ", isInBackground=" + isInBackground
+                + ", windowTitle=" + windowTitle + ", taskId=" + taskId + ", cancelable=" + cancelable + ", state="
+                + state + "]";
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/progress/swing/ProgressMonitorExecutor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/swing/ProgressMonitorExecutor.java	(revision 12675)
+++ trunk/src/org/openstreetmap/josm/gui/progress/swing/ProgressMonitorExecutor.java	(revision 12675)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.progress.swing;
+
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import org.openstreetmap.josm.tools.Utils;
+
+/**
+ * Executor that displays the progress monitor to the user.
+ *
+ * Similar to Executors.newSingleThreadExecutor(), but displays the
+ * progress monitor whenever a new task is executed.
+ * @since 12675 (moved from {@code gui.progress} package}
+ */
+public class ProgressMonitorExecutor extends ThreadPoolExecutor {
+
+    /**
+     * Creates a new {@code ProgressMonitorExecutor}
+     * @param nameFormat see {@link Utils#newThreadFactory(String, int)}
+     * @param threadPriority see {@link Utils#newThreadFactory(String, int)}
+     */
+    public ProgressMonitorExecutor(final String nameFormat, final int threadPriority) {
+        super(1, 1, 0L, TimeUnit.MILLISECONDS,
+                new LinkedBlockingQueue<Runnable>(),
+                Utils.newThreadFactory(nameFormat, threadPriority));
+    }
+
+    @Override
+    public void execute(Runnable command) {
+        if (PleaseWaitProgressMonitor.currentProgressMonitor != null) {
+            //TODO show only if this can't be in background or better if always in background is not checked
+            PleaseWaitProgressMonitor.currentProgressMonitor.showForegroundDialog();
+        }
+        super.execute(command);
+    }
+
+}
Index: trunk/src/org/openstreetmap/josm/gui/progress/swing/SwingRenderingProgressMonitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/swing/SwingRenderingProgressMonitor.java	(revision 12675)
+++ trunk/src/org/openstreetmap/josm/gui/progress/swing/SwingRenderingProgressMonitor.java	(revision 12675)
@@ -0,0 +1,89 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.progress.swing;
+
+import java.awt.Component;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.progress.AbstractProgressMonitor;
+import org.openstreetmap.josm.gui.progress.CancelHandler;
+import org.openstreetmap.josm.gui.progress.ProgressRenderer;
+import org.openstreetmap.josm.gui.progress.ProgressTaskId;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
+
+/**
+ * SwingRenderingProgressMonitor is progress monitor which delegates the rendering
+ * of progress information to a {@link ProgressRenderer}.
+ * Methods of the progress renderer are always called on the Swing EDT.
+ * @since 12675 (moved from {@code gui.progress} package}
+ */
+public class SwingRenderingProgressMonitor extends AbstractProgressMonitor {
+    private static final int PROGRESS_BAR_MAX = 100;
+    private int currentProgressValue;
+    private final ProgressRenderer delegate;
+
+    /**
+     *
+     * @param delegate the delegate which renders the progress information. Must not be null.
+     * @throws IllegalArgumentException if delegate is null
+     */
+    public SwingRenderingProgressMonitor(ProgressRenderer delegate) {
+        super(new CancelHandler());
+        CheckParameterUtil.ensureParameterNotNull(delegate, "delegate");
+        this.delegate = delegate;
+    }
+
+    @Override
+    public void doBeginTask() {
+        GuiHelper.runInEDT(() -> {
+            delegate.setCustomText("");
+            delegate.setMaximum(PROGRESS_BAR_MAX);
+        });
+    }
+
+    @Override
+    public void doFinishTask() {
+        // do nothing
+    }
+
+    @Override
+    protected void updateProgress(double progressValue) {
+        final int newValue = (int) (progressValue * PROGRESS_BAR_MAX);
+        if (newValue != currentProgressValue) {
+            currentProgressValue = newValue;
+            GuiHelper.runInEDT(() -> delegate.setValue(currentProgressValue));
+        }
+    }
+
+    @Override
+    protected void doSetCustomText(final String title) {
+        checkState(State.IN_TASK, State.IN_SUBTASK);
+        GuiHelper.runInEDT(() -> delegate.setCustomText(title));
+    }
+
+    @Override
+    protected void doSetTitle(final String title) {
+        checkState(State.IN_TASK, State.IN_SUBTASK);
+        GuiHelper.runInEDT(() -> delegate.setTaskTitle(title));
+    }
+
+    @Override
+    protected void doSetIntermediate(final boolean value) {
+        GuiHelper.runInEDT(() -> delegate.setIndeterminate(value));
+    }
+
+    @Override
+    public void setProgressTaskId(ProgressTaskId taskId) {
+        // Do nothing
+    }
+
+    @Override
+    public ProgressTaskId getProgressTaskId() {
+        return null;
+    }
+
+    @Override
+    public Component getWindowParent() {
+        return Main.parent;
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/progress/swing/package-info.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/progress/swing/package-info.java	(revision 12675)
+++ trunk/src/org/openstreetmap/josm/gui/progress/swing/package-info.java	(revision 12675)
@@ -0,0 +1,6 @@
+// License: GPL. For details, see LICENSE file.
+
+/**
+ * Provides Swing-based progress monitor implementations.
+ */
+package org.openstreetmap.josm.gui.progress.swing;
