Index: trunk/src/org/openstreetmap/josm/actions/DeleteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/DeleteAction.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/actions/DeleteAction.java	(revision 12749)
@@ -46,3 +46,27 @@
         setEnabled(selection != null && !selection.isEmpty());
     }
+
+    /**
+     * Check whether user is about to delete data outside of the download area.
+     * Request confirmation if he is.
+     * @param primitives the primitives to operate on
+     * @param ignore {@code null} or a primitive to be ignored
+     * @return true, if operating on outlying primitives is OK; false, otherwise
+     * @since 12749 (moved from DeleteCommand)
+     */
+    public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives,
+            Collection<? extends OsmPrimitive> ignore) {
+        return checkAndConfirmOutlyingOperation("delete",
+                tr("Delete confirmation"),
+                tr("You are about to delete nodes outside of the area you have downloaded."
+                        + "<br>"
+                        + "This can cause problems because other objects (that you do not see) might use them."
+                        + "<br>"
+                        + "Do you really want to delete?"),
+                tr("You are about to delete incomplete objects."
+                        + "<br>"
+                        + "This will cause problems because you don''t see the real object."
+                        + "<br>" + "Do you really want to delete?"),
+                primitives, ignore);
+    }
 }
Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 12749)
@@ -505,5 +505,5 @@
 
         // TODO: Only display this warning when nodes outside dataSourceArea are deleted
-        boolean ok = Command.checkAndConfirmOutlyingOperation("joinarea", tr("Join area confirmation"),
+        boolean ok = checkAndConfirmOutlyingOperation("joinarea", tr("Join area confirmation"),
                 trn("The selected way has nodes outside of the downloaded data region.",
                     "The selected ways have nodes outside of the downloaded data region.",
Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 12749)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.GridBagLayout;
 import java.awt.event.KeyEvent;
 import java.util.Collection;
@@ -11,6 +12,9 @@
 
 import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -18,4 +22,5 @@
 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
 import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
+import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
@@ -27,4 +32,5 @@
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
 import org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor;
+import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -394,3 +400,52 @@
         }
     }
+
+    /**
+     * Check whether user is about to operate on data outside of the download area.
+     * Request confirmation if he is.
+     *
+     * @param operation the operation name which is used for setting some preferences
+     * @param dialogTitle the title of the dialog being displayed
+     * @param outsideDialogMessage the message text to be displayed when data is outside of the download area
+     * @param incompleteDialogMessage the message text to be displayed when data is incomplete
+     * @param primitives the primitives to operate on
+     * @param ignore {@code null} or a primitive to be ignored
+     * @return true, if operating on outlying primitives is OK; false, otherwise
+     * @since 12749 (moved from Command)
+     */
+    public static boolean checkAndConfirmOutlyingOperation(String operation,
+            String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
+            Collection<? extends OsmPrimitive> primitives,
+            Collection<? extends OsmPrimitive> ignore) {
+        int checkRes = Command.checkOutlyingOrIncompleteOperation(primitives, ignore);
+        if ((checkRes & Command.IS_OUTSIDE) != 0) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JMultilineLabel("<html>" + outsideDialogMessage + "</html>"));
+            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
+                    operation + "_outside_nodes",
+                    Main.parent,
+                    msg,
+                    dialogTitle,
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.QUESTION_MESSAGE,
+                    JOptionPane.YES_OPTION);
+            if (!answer)
+                return false;
+        }
+        if ((checkRes & Command.IS_INCOMPLETE) != 0) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JMultilineLabel("<html>" + incompleteDialogMessage + "</html>"));
+            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
+                    operation + "_incomplete",
+                    Main.parent,
+                    msg,
+                    dialogTitle,
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.QUESTION_MESSAGE,
+                    JOptionPane.YES_OPTION);
+            if (!answer)
+                return false;
+        }
+        return true;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 12749)
@@ -53,5 +53,5 @@
 
     protected boolean confirmWayWithNodesOutsideBoundingBox(List<? extends OsmPrimitive> primitives) {
-        return DeleteCommand.checkAndConfirmOutlyingDelete(primitives, null);
+        return DeleteAction.checkAndConfirmOutlyingDelete(primitives, null);
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 12749)
@@ -663,5 +663,5 @@
         if (selectedNode != null)
             primitives.add(selectedNode);
-        final boolean ok = Command.checkAndConfirmOutlyingOperation("unglue",
+        final boolean ok = checkAndConfirmOutlyingOperation("unglue",
                 tr("Unglue confirmation"),
                 tr("You are about to unglue nodes outside of the area you have downloaded."
Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 12749)
@@ -2,5 +2,4 @@
 package org.openstreetmap.josm.command;
 
-import java.awt.GridBagLayout;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -10,7 +9,4 @@
 import java.util.Map.Entry;
 import java.util.Objects;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
@@ -24,9 +20,7 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
-import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
@@ -304,52 +298,4 @@
 
     /**
-     * Check whether user is about to operate on data outside of the download area.
-     * Request confirmation if he is.
-     *
-     * @param operation the operation name which is used for setting some preferences
-     * @param dialogTitle the title of the dialog being displayed
-     * @param outsideDialogMessage the message text to be displayed when data is outside of the download area
-     * @param incompleteDialogMessage the message text to be displayed when data is incomplete
-     * @param primitives the primitives to operate on
-     * @param ignore {@code null} or a primitive to be ignored
-     * @return true, if operating on outlying primitives is OK; false, otherwise
-     */
-    public static boolean checkAndConfirmOutlyingOperation(String operation,
-            String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
-            Collection<? extends OsmPrimitive> primitives,
-            Collection<? extends OsmPrimitive> ignore) {
-        int checkRes = checkOutlyingOrIncompleteOperation(primitives, ignore);
-        if ((checkRes & IS_OUTSIDE) != 0) {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JMultilineLabel("<html>" + outsideDialogMessage + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    operation + "_outside_nodes",
-                    Main.parent,
-                    msg,
-                    dialogTitle,
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION);
-            if (!answer)
-                return false;
-        }
-        if ((checkRes & IS_INCOMPLETE) != 0) {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JMultilineLabel("<html>" + incompleteDialogMessage + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    operation + "_incomplete",
-                    Main.parent,
-                    msg,
-                    dialogTitle,
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION);
-            if (!answer)
-                return false;
-        }
-        return true;
-    }
-
-    /**
      * Ensures that all primitives that are participating in this command belong to the affected data set.
      *
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 12749)
@@ -80,4 +80,32 @@
 
     /**
+     * Called when a deletion operation must be checked and confirmed by user.
+     * @since 12749
+     */
+    @FunctionalInterface
+    public interface DeletionCallback {
+        /**
+         * Check whether user is about to delete data outside of the download area.
+         * Request confirmation if he is.
+         * @param primitives the primitives to operate on
+         * @param ignore {@code null} or a primitive to be ignored
+         * @return true, if operating on outlying primitives is OK; false, otherwise
+         */
+        boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore);
+    }
+
+    private static DeletionCallback callback;
+
+    /**
+     * Sets the global {@link DeletionCallback}.
+     * @param deletionCallback the new {@code DeletionCallback}. Must not be null
+     * @throws NullPointerException if {@code deletionCallback} is null
+     * @since 12749
+     */
+    public static void setDeletionCallback(DeletionCallback deletionCallback) {
+        callback = Objects.requireNonNull(deletionCallback);
+    }
+
+    /**
      * The primitives that get deleted.
      */
@@ -325,5 +353,5 @@
         if (parents.isEmpty())
             return null;
-        if (!silent && !checkAndConfirmOutlyingDelete(parents, null))
+        if (!silent && !callback.checkAndConfirmOutlyingDelete(parents, null))
             return null;
         return new DeleteCommand(parents.iterator().next().getDataSet(), parents);
@@ -526,5 +554,5 @@
         }
 
-        if (!silent && !checkAndConfirmOutlyingDelete(
+        if (!silent && !callback.checkAndConfirmOutlyingDelete(
                 primitivesToDelete, Utils.filteredCollection(primitivesToDelete, Way.class)))
             return null;
@@ -628,20 +656,4 @@
             return split != null ? split.getCommand() : null;
         }
-    }
-
-    public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives,
-            Collection<? extends OsmPrimitive> ignore) {
-        return Command.checkAndConfirmOutlyingOperation("delete",
-                tr("Delete confirmation"),
-                tr("You are about to delete nodes outside of the area you have downloaded."
-                        + "<br>"
-                        + "This can cause problems because other objects (that you do not see) might use them."
-                        + "<br>"
-                        + "Do you really want to delete?"),
-                tr("You are about to delete incomplete objects."
-                        + "<br>"
-                        + "This will cause problems because you don''t see the real object."
-                        + "<br>" + "Do you really want to delete?"),
-                primitives, ignore);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12748)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12749)
@@ -59,4 +59,5 @@
 import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.DeleteAction;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.OpenFileAction;
@@ -70,4 +71,5 @@
 import org.openstreetmap.josm.actions.mapmode.DrawAction;
 import org.openstreetmap.josm.actions.search.SearchAction;
+import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.UndoRedoHandler;
@@ -853,4 +855,6 @@
         OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManager.getInstance());
 
+        setupCallbacks();
+
         final SplashScreen splash = GuiHelper.runInEDTAndWaitAndReturn(SplashScreen::new);
         final SplashScreen.SplashProgressMonitor monitor = splash.getProgressMonitor();
@@ -959,4 +963,8 @@
             }
         }
+    }
+
+    static void setupCallbacks() {
+        DeleteCommand.setDeletionCallback(DeleteAction::checkAndConfirmOutlyingDelete);
     }
 
