Index: /trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java	(revision 7678)
+++ /trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java	(revision 7679)
@@ -31,6 +31,4 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
-import org.openstreetmap.josm.data.SelectionChangedListener;
-import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.ExtendedDialog;
@@ -40,24 +38,18 @@
 
 /**
- *
- * @author master
- *
- * Dialog to add tags as part of the remotecontrol
+ * Dialog to add tags as part of the remotecontrol.
  * Existing Keys get grey color and unchecked selectboxes so they will not overwrite the old Key-Value-Pairs by default.
  * You can choose the tags you want to add by selectboxes. You can edit the tags before you apply them.
- *
+ * @author master
+ * @since 3850
  */
-public class AddTagsDialog extends ExtendedDialog implements SelectionChangedListener {
-
-
-    /** initially given tags  **/
-    String[][] tags;
+public class AddTagsDialog extends ExtendedDialog {
 
     private final JTable propertyTable;
-    private Collection<? extends OsmPrimitive> sel;
-    int[] count;
-
-    String sender;
-    static Set<String> trustedSenders = new HashSet<>();
+    private final Collection<? extends OsmPrimitive> sel;
+    private final int[] count;
+
+    private final String sender;
+    private static final Set<String> trustedSenders = new HashSet<>();
 
     /**
@@ -122,5 +114,8 @@
     }
 
-    public AddTagsDialog(String[][] tags, String senderName) {
+    /**
+     * Constructs a new {@code AddTagsDialog}.
+     */
+    public AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives) {
         super(Main.parent, tr("Add tags to selected objects"), new String[] { tr("Add selected tags"), tr("Add all tags"),  tr("Cancel")},
                 false,
@@ -129,7 +124,4 @@
 
         this.sender = senderName;
-
-        DataSet.addSelectionListener(this);
-
 
         final DefaultTableModel tm = new DefaultTableModel(new String[] {tr("Assume"), tr("Key"), tr("Value"), tr("Existing values")}, tags.length) {
@@ -141,5 +133,5 @@
         };
 
-        sel = Main.main.getCurrentDataSet().getSelected();
+        sel = primitives;
         count = new int[tags.length];
 
@@ -168,6 +160,4 @@
         propertyTable = new JTable(tm) {
 
-            private static final long serialVersionUID = 1L;
-
             @Override
             public Component prepareRenderer(TableCellRenderer renderer, int row, int column) {
@@ -200,5 +190,4 @@
                 return tr("Enable the checkbox to accept the value");
             }
-
         };
 
@@ -240,23 +229,4 @@
 
     /**
-     * This method looks for existing tags in the current selection and sets the corresponding boolean in the boolean array existing[]
-     */
-    private void findExistingTags() {
-        TableModel tm = propertyTable.getModel();
-        for (int i=0; i<tm.getRowCount(); i++) {
-            String key = (String)tm.getValueAt(i, 1);
-            String value = (String)tm.getValueAt(i, 1);
-            count[i] = 0;
-            for (OsmPrimitive osm : sel) {
-                if (osm.keySet().contains(key) && !osm.get(key).equals(value)) {
-                    count[i]++;
-                    break;
-                }
-            }
-        }
-        propertyTable.repaint();
-    }
-
-    /**
      * If you click the "Add tags" button build a ChangePropertyCommand for every key that has a checked checkbox to apply the key value pair to all selected osm objects.
      * You get a entry for every key in the command queue.
@@ -280,10 +250,4 @@
         }
         setVisible(false);
-    }
-
-    @Override
-    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-        sel = newSelection;
-        findExistingTags();
     }
 
@@ -323,6 +287,4 @@
                     }
                 }
-
-
             });
         }
@@ -332,5 +294,5 @@
      * Ask user and add the tags he confirm.
      * @param keyValue is a table or {{tag1,val1},{tag2,val2},...}
-     * @param sender is a string for skipping confirmations. Use epmty string for always confirmed adding.
+     * @param sender is a string for skipping confirmations. Use empty string for always confirmed adding.
      * @param primitives OSM objects that will be modified
      * @since 7521
@@ -344,5 +306,5 @@
             }
         } else {
-            new AddTagsDialog(keyValue, sender).showDialog();
+            new AddTagsDialog(keyValue, sender, primitives).showDialog();
         }
     }
