diff --git a/src/org/openstreetmap/josm/actions/JoinAreasAction.java b/src/org/openstreetmap/josm/actions/JoinAreasAction.java
index 99f0a5d..afa32f1 100644
--- a/src/org/openstreetmap/josm/actions/JoinAreasAction.java
+++ b/src/org/openstreetmap/josm/actions/JoinAreasAction.java
@@ -333,23 +333,16 @@ public class JoinAreasAction extends JosmAction {
 
         // TODO: Only display this warning when nodes outside dataSourceArea are deleted
         Area dataSourceArea = Main.main.getCurrentDataSet().getDataSourceArea();
-        if (dataSourceArea != null) {
-            for (Node node : allNodes) {
-                if (!dataSourceArea.contains(node.getCoor())) {
-                    int option = JOptionPane.showConfirmDialog(Main.parent,
-                            trn("The selected way has nodes outside of the downloaded data region.",
-                                    "The selected ways have nodes outside of the downloaded data region.",
-                                    ways.size()) + "\n"
-                                    + tr("This can lead to nodes being deleted accidentally.") + "\n"
-                                    + tr("Are you really sure to continue?"),
-                                    tr("Please abort if you are not sure"), JOptionPane.YES_NO_OPTION,
-                                    JOptionPane.WARNING_MESSAGE);
-
-                    if (option != JOptionPane.YES_OPTION) return;
-                    break;
-                }
-            }
-        }
+        boolean ok = Command.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.",
+                    ways.size()) + "<br/>"
+                    + tr("This can lead to nodes being deleted accidentally.") + "<br/>"
+                    + tr("Are you really sure to continue?")
+                    + tr("Please abort if you are not sure"),
+                tr("The selected area is incomplete. Continue?"),
+                dataSourceArea, allNodes, null);
+        if(!ok) return;
 
         //analyze multipolygon relations and collect all areas
         List<Multipolygon> areas = collectMultipolygons(ways);
diff --git a/src/org/openstreetmap/josm/actions/UnGlueAction.java b/src/org/openstreetmap/josm/actions/UnGlueAction.java
index 8c6b3f2..fadd4de 100644
--- a/src/org/openstreetmap/josm/actions/UnGlueAction.java
+++ b/src/org/openstreetmap/josm/actions/UnGlueAction.java
@@ -60,12 +60,16 @@ public class UnGlueAction extends JosmAction {
      *
      * This method does some checking on the selection and calls the matching unGlueWay method.
      */
+    @Override
     public void actionPerformed(ActionEvent e) {
 
         Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
 
         String errMsg = null;
         if (checkSelection(selection)) {
+            if (!checkAndConfirmOutlyingUnglue()) {
+                return;
+            }
             int count = 0;
             for (Way w : OsmPrimitive.getFilteredList(selectedNode.getReferrers(), Way.class)) {
                 if (!w.isUsable() || w.getNodesCount() < 1) {
@@ -86,6 +90,9 @@ public class UnGlueAction extends JosmAction {
                 unglueWays();
             }
         } else if (checkSelection2(selection)) {
+            if (!checkAndConfirmOutlyingUnglue()) {
+                return;
+            }
             ArrayList<Node> tmpNodes = new ArrayList<Node>();
             for (Node n : selectedNodes) {
                 int count = 0;
@@ -407,4 +414,26 @@ public class UnGlueAction extends JosmAction {
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         setEnabled(selection != null && !selection.isEmpty());
     }
+
+    protected boolean checkAndConfirmOutlyingUnglue() {
+        List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(2 + (selectedNodes == null ? 0 : selectedNodes.size()));
+        if (selectedNodes != null)
+            primitives.addAll(selectedNodes);
+        if (selectedNode != null)
+            primitives.add(selectedNode);
+        if (selectedWay != null)
+            primitives.add(selectedWay);
+        return Command.checkAndConfirmOutlyingOperation("unglue",
+                tr("Unglue confirmation"),
+                tr("You are about to unglue 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 unglue?"),
+                tr("You are about to unglue incomplete objects."
+                        + "<br>"
+                        + "This will cause problems because you don''t see the real object."
+                        + "<br>" + "Do you really want to unglue?"),
+                getEditLayer().data.getDataSourceArea(), primitives, null);
+    }
 }
diff --git a/src/org/openstreetmap/josm/command/Command.java b/src/org/openstreetmap/josm/command/Command.java
index f1ee512..e523197 100644
--- a/src/org/openstreetmap/josm/command/Command.java
+++ b/src/org/openstreetmap/josm/command/Command.java
@@ -1,6 +1,10 @@
 //License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.command;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagLayout;
+import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -8,6 +12,9 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.MutableTreeNode;
 
@@ -18,6 +25,7 @@ import org.openstreetmap.josm.data.osm.PrimitiveData;
 import org.openstreetmap.josm.data.osm.Relation;
 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.layer.Layer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
@@ -170,4 +178,65 @@ abstract public class Command extends PseudoCommand {
         return null;
     }
 
+    /**
+     * Check whether user is about to operate on data outside of the download area.
+     * Request confirmation if he is.
+     *
+     * @param layer the layer in whose context data is deleted
+     * @param primitives the primitives to operate on
+     * @return true, if deleting outlying primitives is OK; false, otherwise
+     */
+    public static boolean checkAndConfirmOutlyingOperation(String operation,
+            String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
+            Area area, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
+        boolean outside = false;
+        boolean incomplete = false;
+        if (area != null) {
+            for (OsmPrimitive osm : primitives) {
+                if (osm.isIncomplete()) {
+                    incomplete = true;
+                } else if (osm instanceof Node && !osm.isNewOrUndeleted()
+                        && !area.contains(((Node) osm).getCoor())
+                        && (ignore == null || !ignore.equals(osm))) {
+                    outside = true;
+                }
+            }
+        } else {
+            for (OsmPrimitive osm : primitives) {
+                if (osm.isIncomplete()) {
+                    incomplete = true;
+                }
+            }
+        }
+        if (outside) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JLabel("<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 (incomplete) {
+            JPanel msg = new JPanel(new GridBagLayout());
+            msg.add(new JLabel("<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;
+    }
+
 }
diff --git a/src/org/openstreetmap/josm/command/DeleteCommand.java b/src/org/openstreetmap/josm/command/DeleteCommand.java
index bbd40b2..aaf4744 100644
--- a/src/org/openstreetmap/josm/command/DeleteCommand.java
+++ b/src/org/openstreetmap/josm/command/DeleteCommand.java
@@ -1,12 +1,11 @@
 // License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.command;
 
+import java.awt.geom.Area;
 import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
 
-import java.awt.GridBagLayout;
-import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -20,10 +19,7 @@ import java.util.Set;
 import java.util.Map.Entry;
 
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.SplitWayAction;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -33,7 +29,6 @@ import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationToChildReference;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.WaySegment;
-import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.gui.DefaultNameFormatter;
 import org.openstreetmap.josm.gui.actionsupport.DeleteFromRelationConfirmationDialog;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -233,7 +228,7 @@ public class DeleteCommand extends Command {
 
         if (parents.isEmpty())
             return null;
-        if (!silent && !checkAndConfirmOutlyingDeletes(layer,parents))
+        if (!silent && !checkAndConfirmOutlyingDelete(layer, parents, null))
             return null;
         return new DeleteCommand(layer,parents);
     }
@@ -330,7 +325,7 @@ public class DeleteCommand extends Command {
             primitivesToDelete.addAll(nodesToDelete);
         }
 
-        if (!silent && !checkAndConfirmOutlyingDeletes(layer,primitivesToDelete))
+        if (!silent && !checkAndConfirmOutlyingDelete(layer, primitivesToDelete, null))
             return null;
 
         waysToBeChanged.addAll(OsmPrimitive.getFilteredSet(OsmPrimitive.getReferrer(primitivesToDelete), Way.class));
@@ -426,81 +421,23 @@ public class DeleteCommand extends Command {
         }
     }
 
-    /**
-     * Check whether user is about to delete data outside of the download area. Request confirmation
-     * if he is.
-     *
-     * @param layer the layer in whose context data is deleted
-     * @param primitivesToDelete the primitives to delete
-     * @return true, if deleting outlying primitives is OK; false, otherwise
-     */
-    private static boolean checkAndConfirmOutlyingDeletes(OsmDataLayer layer, Collection<OsmPrimitive> primitivesToDelete) {
-        Area a = layer.data.getDataSourceArea();
-        boolean outside = false;
-        boolean incomplete = false;
-        if (a != null) {
-            for (OsmPrimitive osm : primitivesToDelete) {
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                } else if (osm instanceof Node && !osm.isNewOrUndeleted()
-                        && !a.contains(((Node) osm).getCoor())) {
-                    outside = true;
-                }
-            }
-        }
-        else
-        {
-            for (OsmPrimitive osm : primitivesToDelete)
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                }
-        }
-        if(outside)
-        {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JLabel(
-                    "<html>" +
-                    // leave message in one tr() as there is a grammatical
-                    // connection.
-                    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?") + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    "delete_outside_nodes",
-                    Main.parent,
-                    msg,
-                    tr("Delete confirmation"),
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION
-            );
-            if(!answer)
-                return false;
-        }
-        if(incomplete)
-        {
-            JPanel msg = new JPanel(new GridBagLayout());
-            msg.add(new JLabel(
-                    "<html>" +
-                    // leave message in one tr() as there is a grammatical
-                    // connection.
-                    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?") + "</html>"));
-            boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
-                    "delete_incomplete",
-                    Main.parent,
-                    msg,
-                    tr("Delete confirmation"),
-                    JOptionPane.YES_NO_OPTION,
-                    JOptionPane.QUESTION_MESSAGE,
-                    JOptionPane.YES_OPTION
-            );
-            if(!answer)
-                return false;
-        }
-        return true;
+    public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
+        return checkAndConfirmOutlyingDelete(layer.data.getDataSourceArea(), primitives, ignore);
+    }
+
+    public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, 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?"),
+                area, primitives, ignore);
     }
+
 }
diff --git a/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java b/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
index 9bcdad3..9869c47 100644
--- a/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
+++ b/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
@@ -23,6 +23,7 @@ import javax.swing.JPanel;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.MergeNodesAction;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Hash;
 import org.openstreetmap.josm.data.osm.Node;
@@ -389,7 +390,7 @@ public class DuplicateNode extends Test {
             target = nodes.iterator().next();
         }
 
-        if (checkAndConfirmOutlyingDeletes(nodes, target))
+        if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, target))
             return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target);
 
         return null;// undoRedo handling done in mergeNodes
@@ -405,40 +406,4 @@ public class DuplicateNode extends Test {
         // everything else is ok to merge
         return true;
     }
-
-    /**
-     * Check whether user is about to delete data outside of the download area.
-     * Request confirmation if he is.
-     */
-    private static boolean checkAndConfirmOutlyingDeletes(LinkedHashSet<Node> del, Node ignore) {
-        Area a = Main.main.getCurrentDataSet().getDataSourceArea();
-        if (a != null) {
-            for (OsmPrimitive osm : del) {
-                if (osm instanceof Node && !osm.isNew() && osm != ignore) {
-                    Node n = (Node) osm;
-                    if (!a.contains(n.getCoor())) {
-                        JPanel msg = new JPanel(new GridBagLayout());
-                        msg.add(new JLabel(
-                                "<html>" +
-                                // leave message in one tr() as there is a grammatical
-                                // connection.
-                                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?") + "</html>"));
-
-                        return ConditionalOptionPaneUtil.showConfirmationDialog(
-                                "delete_outside_nodes",
-                                Main.parent,
-                                msg,
-                                tr("Delete confirmation"),
-                                JOptionPane.YES_NO_OPTION,
-                                JOptionPane.QUESTION_MESSAGE,
-                                JOptionPane.YES_OPTION);
-                    }
-                }
-            }
-        }
-        return true;
-    }
 }
