Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 12726)
+++ 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 12726)
+++ 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);
     }
 
