Index: /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecPluginHelper.java
===================================================================
--- /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecPluginHelper.java	(revision 31626)
+++ /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecPluginHelper.java	(revision 31627)
@@ -37,5 +37,4 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.io.EOFException;
 import java.io.File;
 import java.io.FileInputStream;
@@ -80,5 +79,4 @@
 import javax.swing.JDialog;
 import javax.swing.JFileChooser;
-import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JList;
@@ -122,5 +120,5 @@
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionListItem;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
+//import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
@@ -350,21 +348,4 @@
 
     public final class TrainingDialog extends AbstractTagsDialog {
-//        final String key;
-//        final Map<String, Integer> m;
-//        final int row;
-
-//        Comparator<AutoCompletionListItem> usedValuesAwareComparator = new Comparator<AutoCompletionListItem>() {
-//                @Override
-//                public int compare(AutoCompletionListItem o1, AutoCompletionListItem o2) {
-//                    boolean c1 = m.containsKey(o1.getValue());
-//                    boolean c2 = m.containsKey(o2.getValue());
-//                    if (c1 == c2)
-//                        return String.CASE_INSENSITIVE_ORDER.compare(o1.getValue(), o2.getValue());
-//                    else if (c1)
-//                        return -1;
-//                    else
-//                        return +1;
-//                }
-//            };
 
         ListCellRenderer<AutoCompletionListItem> cellRenderer = new ListCellRenderer<AutoCompletionListItem>() {
@@ -433,8 +414,4 @@
             setButtonIcons(new String[] {"ok","cancel"});
             setCancelButton(2);
-            //configureContextsensitiveHelp("/Dialog/EditValue", true /* show help button */);
-//            this.key = key;
-//            this.row = row;
-//            this.m = map;
             
             JPanel mainPanel = new JPanel(new BorderLayout(10,10));   //6,6
@@ -488,6 +465,5 @@
             daysField.setEnabled(false);
             userNameField.setColumns(FIELD_COLUMNS);
-            daysField.setColumns(FIELD_COLUMNS);
-            
+            daysField.setColumns(FIELD_COLUMNS);           
             
             Collection<String> fileHistory = Main.pref.getCollection("file-open.history");
@@ -765,26 +741,4 @@
             List<AutoCompletionListItem> keyList = autocomplete.getKeys();
             Collections.sort(keyList, defaultACItemComparator);
-
-//            keys = new AutoCompletingComboBox(key);
-//            keys.setPossibleACItems(keyList);
-//            keys.setEditable(true);
-//            keys.setSelectedItem(key);
-
-//            List<AutoCompletionListItem> valueList = autocomplete.getValues(getAutocompletionKeys(key));
-//            Collections.sort(valueList, usedValuesAwareComparator);
-//            final String selection= m.size()!=1?tr("<different>"):m.entrySet().iterator().next().getKey();
-//            values = new AutoCompletingComboBox(selection);
-//            values.setRenderer(cellRenderer);
-//            values.setEditable(true);
-//            values.setPossibleACItems(valueList);
-//            values.setSelectedItem(selection);
-//            values.getEditor().setItem(selection);
-//            values.getEditor().addActionListener(new ActionListener() {
-//                @Override
-//                public void actionPerformed(ActionEvent e) {
-//                    buttonAction(0, null); // emulate OK button click
-//                }
-//            });
-//            addFocusAdapter(autocomplete, usedValuesAwareComparator);
 
             setContent(mainPanel, false);
@@ -1022,67 +976,4 @@
             }
         }
-        
-//         /**
-//         * Edit tags of multiple selected objects according to selected ComboBox values
-//         * If value == "", tag will be deleted
-//         * Confirmations may be needed.
-//         */
-//        private void performTagEdit() {
-//            String value = Tag.removeWhiteSpaces(values.getEditor().getItem().toString());
-//            value = Normalizer.normalize(value, java.text.Normalizer.Form.NFC);
-//            if (value.isEmpty()) {
-//                value = null; // delete the key
-//            }
-//            String newkey = Tag.removeWhiteSpaces(keys.getEditor().getItem().toString());
-//            newkey = Normalizer.normalize(newkey, java.text.Normalizer.Form.NFC);
-//            if (newkey.isEmpty()) {
-//                newkey = key;
-//                value = null; // delete the key instead
-//            }
-//            if (key.equals(newkey) && tr("<different>").equals(value))
-//                return;
-//            if (key.equals(newkey) || value == null) {
-//                Main.main.undoRedo.add(new ChangePropertyCommand(sel, newkey, value));
-//                AutoCompletionManager.rememberUserInput(newkey, value, true);
-//            } else {
-//                for (OsmPrimitive osm: sel) {
-//                    if (osm.get(newkey) != null) {
-//                        if (!warnOverwriteKey(tr("You changed the key from ''{0}'' to ''{1}''.", key, newkey),
-//                                "overwriteEditKey"))
-//                            return;
-//                        break;
-//                    }
-//                }
-//                Collection<Command> commands = new ArrayList<>();
-//                commands.add(new ChangePropertyCommand(sel, key, null));
-//                if (value.equals(tr("<different>"))) {
-//                    Map<String, List<OsmPrimitive>> map = new HashMap<>();
-//                    for (OsmPrimitive osm: sel) {
-//                        String val = osm.get(key);
-//                        if (val != null) {
-//                            if (map.containsKey(val)) {
-//                                map.get(val).add(osm);
-//                            } else {
-//                                List<OsmPrimitive> v = new ArrayList<>();
-//                                v.add(osm);
-//                                map.put(val, v);
-//                            }
-//                        }
-//                    }
-//                    for (Map.Entry<String, List<OsmPrimitive>> e: map.entrySet()) {
-//                        commands.add(new ChangePropertyCommand(e.getValue(), newkey, e.getKey()));
-//                    }
-//                } else {
-//                    commands.add(new ChangePropertyCommand(sel, newkey, value));
-//                    AutoCompletionManager.rememberUserInput(newkey, value, false);
-//                }
-//                Main.main.undoRedo.add(new SequenceCommand(
-//                        trn("Change properties of up to {0} object",
-//                                "Change properties of up to {0} objects", sel.size(), sel.size()),
-//                                commands));
-//            }
-//
-//            changedKey = newkey;
-//        }
     }
 
@@ -1424,53 +1315,8 @@
                 }
             };            
-            
-            
-            //pane.showConfirmDialog();
-            //pane.addPropertyChangeListener(JOptionPane.VALUE_PROPERTY);
-            
-            
-             //JButton ok = dlg.getRootPane().getDefaultButton();
+
             dlg = pane.createDialog(Main.parent, tr("Model Settings"));
             dlg.setVisible(true);  
             
-            /*
-            //returned value of pane.getValue indicates the key pressed by the user. "0" is for the OK button
-            int buttonValue = -1;
-            if(pane.getValue() != null){
-                //System.out.println("type? " + pane.getValue());
-                buttonValue = (int) pane.getValue();
-            }
-
-            System.out.println("value of model sel button: " + pane.getValue());           
-           
-            if(buttonValue == 0 && useModelCombinationCheckbox.isSelected()){
-                useCombinedModel = true;
-                System.out.println("\nold - USE COMBINED MODEL\n");
-                //recompute predictions with combination
-                
-                //modelWithClasses = false;
-                addDialog.loadSVMmodel(); 
-                addDialog.createOSMObject(sel);                               
-                saveCombinedModel();
-                dlg.setVisible(false);
-                //this.setVisible(false);
-            }
-            else if(useModelCombinationCheckbox.isSelected()){
-                useCombinedModel = true;
-                System.out.println("old - use combined model");
-                
-                addDialog.loadSVMmodel();
-                addDialog.createOSMObject(sel);
-                dlg.setVisible(false);
-            } 
-            else{
-                System.out.println("old - don t use combined model, use custom model");
-                useCombinedModel = false;
-                useCustomSVMModel = true;
-                addDialog.loadSVMmodel();
-                addDialog.createOSMObject(sel);
-                dlg.setVisible(false);
-            }
-            */
         }
         
@@ -1505,5 +1351,5 @@
                     else{
                          if(svmModelPath.contains("\\")){
-                            svmModelText = svmModelPath.substring(svmModelPath.lastIndexOf("/"));
+                            svmModelText = svmModelPath.substring(svmModelPath.lastIndexOf("\\"));
                         }
                         else{
@@ -1572,4 +1418,5 @@
                 
                 try{
+                    //TODO replace "," with "." to parse doubles with commas
                     Double weightValue = Double.parseDouble(weightField.getText());
 
@@ -1660,6 +1507,11 @@
                 } finally {
                     try {
-                        in.close();
-                        fileIn.close();
+                        if(in!=null){
+                            in.close();
+                        }
+                        if(fileIn!=null){
+                            fileIn.close();
+                        }
+                        
                     } catch (IOException ex) {
                         Logger.getLogger(OSMRecPluginHelper.class.getName()).log(Level.SEVERE, null, ex);
@@ -1734,6 +1586,6 @@
             JPanel mainPanel = new JPanel(new GridBagLayout()); //original panel, will be wrapped by the splitPanel                   
             JPanel recommendPanel = new JPanel(new BorderLayout(10,10));   //will contain listPanel, action panel           
-            JPanel  listPanel = new JPanel(new BorderLayout(10,10)); //class recommend label, recommendation list
-            JPanel  actionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); //model selection buttons or configuration
+            JPanel listPanel = new JPanel(new BorderLayout(10,10)); //class recommend label, recommendation list
+            JPanel actionsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); //model selection buttons or configuration
             
             addAndContinueButton = new javax.swing.JButton("Add and continue");
@@ -2063,10 +1915,10 @@
                     Map<String, String> map = new HashMap<>();
                     map.put(t.getKey(), t.getValue());
-                    for (TaggingPreset tp : TaggingPreset.getMatchingPresets(null, map, false)) {
-                        icon = tp.getIcon();
-                        if (icon != null) {
-                            break;
-                        }
-                    }
+//                    for (TaggingPreset tp : TaggingPreset.getMatchingPresets(null, map, false)) {
+//                        icon = tp.getIcon();
+//                        if (icon != null) {
+//                            break;
+//                        }
+//                    }
                     // If still nothing display an empty icon
                     if (icon == null) {
@@ -2168,5 +2020,5 @@
         private void loadSVMmodel() {
             File modelDirectory = new File(MODEL_PATH);
-            File modelFile = null;
+            File modelFile;
             if(useCombinedModel){
                 if(filesAndWeights.isEmpty()){
@@ -2175,8 +2027,28 @@
                         System.out.println("Using default/last model with classes: " + modelDirectory.getAbsolutePath() + "/model_with_classes");
                         modelFile = new File(modelDirectory.getAbsolutePath() + "/model_with_classes");
+                        try {
+                            System.out.println("try to load model: " + modelFile.getAbsolutePath());
+                            modelSVM = Model.load(modelFile);
+                            System.out.println("model loaded!");
+
+                        } catch (IOException ex) {
+                            Logger.getLogger(TrainWorker.class.getName()).log(Level.SEVERE, null, ex);
+                        }
+                        modelSVMLabelSize = modelSVM.getLabels().length;
+                        modelSVMLabels = modelSVM.getLabels();
                     }
                     else{
                         System.out.println("Using default/last model without classes: " + modelDirectory.getAbsolutePath() + "/best_model");
                         modelFile = new File(modelDirectory.getAbsolutePath() + "/best_model");
+                        try {
+                            System.out.println("try to load model: " + modelFile.getAbsolutePath());
+                            modelSVM = Model.load(modelFile);
+                            System.out.println("model loaded!");
+
+                        } catch (IOException ex) {
+                            Logger.getLogger(TrainWorker.class.getName()).log(Level.SEVERE, null, ex);
+                        }
+                        modelSVMLabelSize = modelSVM.getLabels().length;
+                        modelSVMLabels = modelSVM.getLabels();
                     } 
                 }               
@@ -2273,50 +2145,5 @@
                 modelSVMLabelSize = modelSVM.getLabels().length;
                 modelSVMLabels = modelSVM.getLabels();                
-            }
-            
-
-            
-            //try to use last SVM model
-            /*
-            if(useCombinedModel){
-                System.out.println("Using combined model.");
-                if(modelWithClasses){ //check filenames to define if model with classes is selected
-                    useCombinedSVMmodels(sel, true);
-                }
-                else{
-                    useCombinedSVMmodels(sel, false);
-                }
-                
-                return;        
-            }
-            //String modelDirectoryPath = new File(MAIN_PATH).getParentFile() + "/OSMRec_models";
-            //File modelDirectory = new File(MODEL_PATH);
-            
-            //File modelFile;
-            if(useCustomSVMModel){
-                System.out.println("using custom model: " + customSVMModelPath);
-                modelFile = new File(customSVMModelPath);
-            }
-            else{
-                if(modelWithClasses){
-                    System.out.println("using model with classes: " + modelDirectory.getAbsolutePath() + "/model_with_classes");
-                    modelFile = new File(modelDirectory.getAbsolutePath() + "/model_with_classes");
-                }
-                else {
-                    System.out.println("using best model: " + modelDirectory.getAbsolutePath() + "/best_model");
-                    modelFile = new File(modelDirectory.getAbsolutePath() + "/best_model");
-                }                
-            }
-            
-            try {
-                modelSVM = Model.load(modelFile);
-                //System.out.println("model loaded: " + modelFile.getAbsolutePath());
-            } catch (IOException ex) {
-                Logger.getLogger(TrainWorker.class.getName()).log(Level.SEVERE, null, ex);
-            }
-            modelSVMLabelSize = modelSVM.getLabels().length;
-            modelSVMLabels = modelSVM.getLabels();
-            //System.out.println("is model path same as this? " + MODEL_PATH + "\n" + modelDirectoryPath);
-            */        
+            }                   
         }
         
@@ -2752,62 +2579,4 @@
                 }                
                 
-                /*
-                int predicted1 = modelSVMLabels[scoresValues.get(scores[scores.length-1])];  
-                int predicted2 = modelSVMLabels[scoresValues.get(scores[scores.length-2])];
-                int predicted3 = modelSVMLabels[scoresValues.get(scores[scores.length-3])];
-                int predicted4 = modelSVMLabels[scoresValues.get(scores[scores.length-4])];  
-                int predicted5 = modelSVMLabels[scoresValues.get(scores[scores.length-5])];
-                int predicted6 = modelSVMLabels[scoresValues.get(scores[scores.length-6])];
-                int predicted7 = modelSVMLabels[scoresValues.get(scores[scores.length-7])];  
-                int predicted8 = modelSVMLabels[scoresValues.get(scores[scores.length-8])];
-                int predicted9 = modelSVMLabels[scoresValues.get(scores[scores.length-9])];
-                int predicted10 = modelSVMLabels[scoresValues.get(scores[scores.length-10])];                  
-              
-                //System.out.println("classes predicted: " + na1 + " " + na2 + " " + na3);
-                String[] predictedTags = new String[10];
-                for( Map.Entry<String, Integer> entry : mapperWithIDs.entrySet()){
-                    
-                    if(entry.getValue().equals(predicted1)){
-                        //System.out.println("1st predicted class: " +entry.getKey());                     
-                        predictedTags[0] = entry.getKey();
-                    }
-                    else if(entry.getValue().equals(predicted2)){
-                        predictedTags[1] = entry.getKey();
-                        //System.out.println("2nd predicted class: " +entry.getKey());
-                    }
-                    else if(entry.getValue().equals(predicted3)){
-                        predictedTags[2] = entry.getKey();
-                        //System.out.println("3rd predicted class: " +entry.getKey()); 
-                    }
-                    else if(entry.getValue().equals(predicted4)){
-                        predictedTags[3] = entry.getKey();
-                        //System.out.println("2nd predicted class: " +entry.getKey());
-                    }
-                    else if(entry.getValue().equals(predicted5)){
-                        predictedTags[4] = entry.getKey();
-                        //System.out.println("3rd predicted class: " +entry.getKey()); 
-                    }                    
-                    else if(entry.getValue().equals(predicted6)){
-                        predictedTags[5] = entry.getKey();
-                        //System.out.println("2nd predicted class: " +entry.getKey());
-                    }
-                    else if(entry.getValue().equals(predicted7)){
-                        predictedTags[6] = entry.getKey();
-                        //System.out.println("3rd predicted class: " +entry.getKey()); 
-                    }
-                    else if(entry.getValue().equals(predicted8)){
-                        predictedTags[7] = entry.getKey();
-                        //System.out.println("2nd predicted class: " +entry.getKey());
-                    }
-                    else if(entry.getValue().equals(predicted9)){
-                        predictedTags[8] = entry.getKey();
-                        //System.out.println("3rd predicted class: " +entry.getKey()); 
-                    }     
-                    else if(entry.getValue().equals(predicted10)){
-                        predictedTags[9] = entry.getKey();
-                        //System.out.println("3rd predicted class: " +entry.getKey()); 
-                    }                     
-                }
-                */
                 //clearing model, to add the new computed classes in jlist
                 model.clear();
Index: /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecToggleDialog.java
===================================================================
--- /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecToggleDialog.java	(revision 31626)
+++ /applications/editors/josm/plugins/OSMRecPlugin/src/org/openstreetmap/josm/plugins/osmrec/OSMRecToggleDialog.java	(revision 31627)
@@ -2,17 +2,9 @@
 package org.openstreetmap.josm.plugins.osmrec;
 
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Font;
 import java.awt.GridBagLayout;
-import java.awt.Point;
 import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -20,8 +12,6 @@
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -29,72 +19,27 @@
 import java.util.Set;
 import java.util.TreeMap;
-import java.util.TreeSet;
-
-import javax.swing.AbstractAction;
-import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.KeyStroke;
-import javax.swing.ListSelectionModel;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
-import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
-import org.openstreetmap.josm.actions.relation.DownloadMembersAction;
-import org.openstreetmap.josm.actions.relation.DownloadSelectedIncompleteMembersAction;
-import org.openstreetmap.josm.actions.relation.SelectInRelationListAction;
-import org.openstreetmap.josm.actions.relation.SelectMembersAction;
-import org.openstreetmap.josm.actions.relation.SelectRelationAction;
-import org.openstreetmap.josm.actions.search.SearchAction.SearchMode;
-import org.openstreetmap.josm.actions.search.SearchAction.SearchSetting;
-import org.openstreetmap.josm.command.ChangeCommand;
-import org.openstreetmap.josm.command.ChangePropertyCommand;
-import org.openstreetmap.josm.command.Command;
-import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
 import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.osm.IRelation;
-import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Tag;
-import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter;
-import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
-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.DefaultNameFormatter;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.MapView;
-import org.openstreetmap.josm.gui.PopupMenuHandler;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
-import org.openstreetmap.josm.gui.dialogs.properties.PresetListPanel;
-import org.openstreetmap.josm.gui.dialogs.properties.PropertiesCellRenderer;
-import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
-import org.openstreetmap.josm.gui.help.HelpUtil;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetHandler;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetType;
-import org.openstreetmap.josm.gui.util.GuiHelper;
-import org.openstreetmap.josm.gui.util.HighlightHelper;
-import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
-import org.openstreetmap.josm.tools.GBC;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.tools.InputMapUtils;
-import org.openstreetmap.josm.tools.LanguageInfo;
-import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Predicates;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -102,5 +47,5 @@
 
 /**
- * This class is a modification of the PropertiesDialog.
+ * This class is a modification of the PropertiesDialog for the OSMRec.
  * 
  * 
@@ -120,7 +65,8 @@
  *
  * @author imi
+ * @author nkaragiannakis
  */
 public class OSMRecToggleDialog extends ToggleDialog
-implements SelectionChangedListener, MapView.EditLayerChangeListener, DataSetListenerAdapter.Listener {
+implements SelectionChangedListener, DataSetListenerAdapter.Listener {
 
     /**
@@ -152,14 +98,4 @@
     private final JPanel bothTables = new JPanel();
 
-    // Popup menus
-    private final JPopupMenu tagMenu = new JPopupMenu();
-    private final JPopupMenu membershipMenu = new JPopupMenu();
-    private final JPopupMenu blankSpaceMenu = new JPopupMenu();
-
-    // Popup menu handlers
-    private final transient PopupMenuHandler tagMenuHandler = new PopupMenuHandler(tagMenu);
-    private final transient PopupMenuHandler membershipMenuHandler = new PopupMenuHandler(membershipMenu);
-    private final transient PopupMenuHandler blankSpaceMenuHandler = new PopupMenuHandler(blankSpaceMenu);
-
     private final transient Map<String, Map<String, Integer>> valueCount = new TreeMap<>();
     /**
@@ -168,30 +104,8 @@
     private final transient OSMRecPluginHelper editHelper = new OSMRecPluginHelper(tagData, valueCount);
 
-    private final transient DataSetListenerAdapter dataChangedAdapter = new DataSetListenerAdapter(this);
-    private final HelpAction helpAction = new HelpAction();
-    private final PasteValueAction pasteValueAction = new PasteValueAction();
-    private final CopyValueAction copyValueAction = new CopyValueAction();
-    private final CopyKeyValueAction copyKeyValueAction = new CopyKeyValueAction();
-    private final CopyAllKeyValueAction copyAllKeyValueAction = new CopyAllKeyValueAction();
-    private final SearchAction searchActionSame = new SearchAction(true);
-    private final SearchAction searchActionAny = new SearchAction(false);
     private final AddAction addAction = new AddAction();
     private final EditActionTrain editAction = new EditActionTrain();
-    private final DeleteAction deleteAction = new DeleteAction();
-    private final JosmAction[] josmActions = new JosmAction[]{addAction, editAction, deleteAction};
-
-    // relation actions
-    private final SelectInRelationListAction setRelationSelectionAction = new SelectInRelationListAction();
-    private final SelectRelationAction selectRelationAction = new SelectRelationAction(false);
-    private final SelectRelationAction addRelationToSelectionAction = new SelectRelationAction(true);
-
-    private final DownloadMembersAction downloadMembersAction = new DownloadMembersAction();
-    private final DownloadSelectedIncompleteMembersAction downloadSelectedIncompleteMembersAction =
-    		new DownloadSelectedIncompleteMembersAction();
-
-    private final SelectMembersAction selectMembersAction = new SelectMembersAction(false);
-    private final SelectMembersAction addMembersToSelectionAction = new SelectMembersAction(true);
-
-    private final transient HighlightHelper highlightHelper= new HighlightHelper();
+//    private final DeleteAction deleteAction = new DeleteAction();
+//    private final JosmAction[] josmActions = new JosmAction[]{addAction, editAction, deleteAction};
 
     /**
@@ -203,12 +117,4 @@
      */
     private final SideButton btnEdit = new SideButton(editAction);
-    /**
-     * The Delete button (needed to be able to disable it)
-     */
-    private final SideButton btnDel = new SideButton(deleteAction);
-    /**
-     * Matching preset display class
-     */
-    private final PresetListPanel presets = new PresetListPanel();
 
     /**
@@ -218,20 +124,8 @@
             + tr("Select objects or create new objects and get recommendation.") + "</p></html>");
 
-    private final transient TaggingPresetHandler presetHandler = new TaggingPresetHandler() {
-        @Override public void updateTags(List<Tag> tags) {
-            Command command = TaggingPreset.createCommand(getSelection(), tags);
-            if (command != null) Main.main.undoRedo.add(command);
-        }
-
-        @Override public Collection<OsmPrimitive> getSelection() {
-            if (Main.main == null) return null;
-            return Main.main.getInProgressSelection();
-        }
-    };
-
     // <editor-fold defaultstate="collapsed" desc="Dialog construction and helper methods">
 
     /**
-     * Create a new PropertiesDialog
+     * Create a new OSMRecToggleDialog
      */
     public OSMRecToggleDialog() {
@@ -239,41 +133,14 @@
                 Shortcut.registerShortcut("subwindow:properties", tr("Toggle: {0}", tr("Tags/Memberships")), KeyEvent.VK_P,
                         Shortcut.ALT_SHIFT), 150, true);
-        HelpUtil.setHelpContext(this, HelpUtil.ht("/Dialog/TagsMembership"));
-        
-        setupTagsMenu();
-        buildTagsTable(); //my
-
-        setupMembershipMenu(); //my
-        buildMembershipTable(); 
-
-        // combine both tables and wrap them in a scrollPane
-        boolean top = Main.pref.getBoolean("properties.presets.top", true);
+
+        System.out.println("cleaning test..");
         bothTables.setLayout(new GridBagLayout());
-        if(top) {
-            bothTables.add(presets, GBC.std().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2).anchor(GBC.NORTHWEST));
-            double epsilon = Double.MIN_VALUE; // need to set a weight or else anchor value is ignored
-            bothTables.add(pluginHook, GBC.eol().insets(0,1,1,1).anchor(GBC.NORTHEAST).weight(epsilon, epsilon));
-        }
-        bothTables.add(selectSth, GBC.eol().fill().insets(10, 10, 10, 10));
-        bothTables.add(tagTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
-        bothTables.add(tagTable, GBC.eol().fill(GBC.BOTH));
-        bothTables.add(membershipTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
-        bothTables.add(membershipTable, GBC.eol().fill(GBC.BOTH));
-        if(!top) {
-            bothTables.add(presets, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 2, 5, 2));
-        }
-
         bothTables.setVisible(false); //my
-        setupBlankSpaceMenu();
-        setupKeyboardShortcuts();
-
         // Let the actions know when selection in the tables change
         tagTable.getSelectionModel().addListSelectionListener(editAction);
         membershipTable.getSelectionModel().addListSelectionListener(editAction);
-        tagTable.getSelectionModel().addListSelectionListener(deleteAction);
-        membershipTable.getSelectionModel().addListSelectionListener(deleteAction);
 
         JScrollPane scrollPane = (JScrollPane) createLayout(bothTables, true,
-                Arrays.asList(this.btnAdd, this.btnEdit, this.btnDel));
+                Arrays.asList(this.btnAdd, this.btnEdit));
 
         MouseClickWatch mouseClickWatch = new MouseClickWatch();
@@ -281,227 +148,6 @@
         membershipTable.addMouseListener(mouseClickWatch);
         scrollPane.addMouseListener(mouseClickWatch);
-
-        selectSth.setPreferredSize(scrollPane.getSize());
-        presets.setSize(scrollPane.getSize());
-
         editHelper.loadTagsIfNeeded(); 
 
-        Main.pref.addPreferenceChangeListener(this);
-        scrollPane.setVisible(false); //my //hide the tags/memberships altogether
-    }
-
-    private void buildTagsTable() {
-        // setting up the tags table
-        tagData.setColumnIdentifiers(new String[]{tr("Key"),tr("Value")});
-        
-        tagTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-        tagTable.getTableHeader().setReorderingAllowed(false);
-
-        PropertiesCellRenderer cellRenderer = new PropertiesCellRenderer();
-        tagTable.getColumnModel().getColumn(0).setCellRenderer(cellRenderer);
-        tagTable.getColumnModel().getColumn(1).setCellRenderer(cellRenderer);
-        
-    }
-
-    private void buildMembershipTable() {
-        membershipData.setColumnIdentifiers(new String[]{tr("Member Of"),tr("Role"),tr("Position")});
-        membershipTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
-        TableColumnModel mod = membershipTable.getColumnModel();
-        membershipTable.getTableHeader().setReorderingAllowed(false);
-        mod.getColumn(0).setCellRenderer(new DefaultTableCellRenderer() {
-            @Override public Component getTableCellRendererComponent(JTable table, Object value,
-                    boolean isSelected, boolean hasFocus, int row, int column) {
-                Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
-                if (value == null)
-                    return this;
-                if (c instanceof JLabel) {
-                    JLabel label = (JLabel)c;
-                    Relation r = (Relation)value;
-                    label.setText(r.getDisplayName(DefaultNameFormatter.getInstance()));
-                    if (r.isDisabledAndHidden()) {
-                        label.setFont(label.getFont().deriveFont(Font.ITALIC));
-                    }
-                }
-                return c;
-            }
-        });
-
-        mod.getColumn(1).setCellRenderer(new DefaultTableCellRenderer() {
-            @Override public Component getTableCellRendererComponent(JTable table, Object value,
-                    boolean isSelected, boolean hasFocus, int row, int column) {
-                if (value == null)
-                    return this;
-                Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
-                boolean isDisabledAndHidden = ((Relation) table.getValueAt(row, 0)).isDisabledAndHidden();
-                if (c instanceof JLabel) {
-                    JLabel label = (JLabel) c;
-                    label.setText(((MemberInfo) value).getRoleString());
-                    if (isDisabledAndHidden) {
-                        label.setFont(label.getFont().deriveFont(Font.ITALIC));
-                    }
-                }
-                return c;
-            }
-        });
-
-        mod.getColumn(2).setCellRenderer(new DefaultTableCellRenderer() {
-            @Override public Component getTableCellRendererComponent(JTable table, Object value,
-                    boolean isSelected, boolean hasFocus, int row, int column) {
-                Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column);
-                boolean isDisabledAndHidden = ((Relation) table.getValueAt(row, 0)).isDisabledAndHidden();
-                if (c instanceof JLabel) {
-                    JLabel label = (JLabel)c;
-                    label.setText(((MemberInfo) table.getValueAt(row, 1)).getPositionString());
-                    if (isDisabledAndHidden) {
-                        label.setFont(label.getFont().deriveFont(Font.ITALIC));
-                    }
-                }
-                return c;
-            }
-        });
-        mod.getColumn(2).setPreferredWidth(20);
-        mod.getColumn(1).setPreferredWidth(40);
-        mod.getColumn(0).setPreferredWidth(200);
-    }
-
-    /**
-     * Creates the popup menu @field blankSpaceMenu and its launcher on main panel.
-     */
-    private void setupBlankSpaceMenu() {
-        if (Main.pref.getBoolean("properties.menu.add_edit_delete", true)) {
-            blankSpaceMenuHandler.addAction(addAction);
-            PopupMenuLauncher launcher = new PopupMenuLauncher(blankSpaceMenu) {
-                @Override
-                protected boolean checkSelection(Component component, Point p) {
-                    if (component instanceof JTable) {
-                        return ((JTable) component).rowAtPoint(p) == -1;
-                    }
-                    return true;
-                }
-            };
-            bothTables.addMouseListener(launcher);
-            tagTable.addMouseListener(launcher);
-        }
-    }
-
-    /**
-     * Creates the popup menu @field membershipMenu and its launcher on membership table.
-     */
-    private void setupMembershipMenu() {
-        // setting up the membership table
-        if (Main.pref.getBoolean("properties.menu.add_edit_delete", true)) {
-            membershipMenuHandler.addAction(editAction);
-            membershipMenuHandler.addAction(deleteAction);
-            membershipMenu.addSeparator();
-        }
-        membershipMenuHandler.addAction(setRelationSelectionAction);
-        membershipMenuHandler.addAction(selectRelationAction);
-        membershipMenuHandler.addAction(addRelationToSelectionAction);
-        membershipMenuHandler.addAction(selectMembersAction);
-        membershipMenuHandler.addAction(addMembersToSelectionAction);
-        membershipMenu.addSeparator();
-        membershipMenuHandler.addAction(downloadMembersAction);
-        membershipMenuHandler.addAction(downloadSelectedIncompleteMembersAction);
-        membershipMenu.addSeparator();
-        membershipMenu.add(helpAction);
-
-        membershipTable.addMouseListener(new PopupMenuLauncher(membershipMenu) {
-            @Override
-            protected int checkTableSelection(JTable table, Point p) {
-                int row = super.checkTableSelection(table, p);
-                List<Relation> rels = new ArrayList<>();
-                for (int i: table.getSelectedRows()) {
-                    rels.add((Relation) table.getValueAt(i, 0));
-                }
-                membershipMenuHandler.setPrimitives(rels);
-                return row;
-            }
-
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                //update highlights
-                if (Main.isDisplayingMapView()) {
-                    int row = membershipTable.rowAtPoint(e.getPoint());
-                    if (row>=0) {
-                        if (highlightHelper.highlightOnly((Relation) membershipTable.getValueAt(row, 0))) {
-                            Main.map.mapView.repaint();
-                        }
-                    }
-                }
-                super.mouseClicked(e);
-            }
-
-            @Override
-            public void mouseExited(MouseEvent me) {
-                highlightHelper.clear();
-            }
-        });
-    }
-
-    /**
-     * Creates the popup menu @field tagMenu and its launcher on tag table.
-     */
-    private void setupTagsMenu() {
-        if (Main.pref.getBoolean("properties.menu.add_edit_delete", true)) {
-            tagMenu.add(addAction);
-            tagMenu.add(editAction);
-            tagMenu.add(deleteAction);
-            tagMenu.addSeparator();
-        }
-        tagMenu.add(pasteValueAction);
-        tagMenu.add(copyValueAction);
-        tagMenu.add(copyKeyValueAction);
-        tagMenu.add(copyAllKeyValueAction);
-        tagMenu.addSeparator();
-        tagMenu.add(searchActionAny);
-        tagMenu.add(searchActionSame);
-        tagMenu.addSeparator();
-        tagMenu.add(helpAction);
-        tagTable.addMouseListener(new PopupMenuLauncher(tagMenu));
-    }
-
-    /**
-     * Assigns all needed keys like Enter and Spacebar to most important actions.
-     */
-    private void setupKeyboardShortcuts() {
-
-        // ENTER = editAction, open "edit" dialog
-        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
-                .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "onTableEnter");
-        tagTable.getActionMap().put("onTableEnter",editAction);
-        membershipTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
-                .put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"onTableEnter");
-        membershipTable.getActionMap().put("onTableEnter",editAction);
-
-        // INSERT button = addAction, open "add tag" dialog
-        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
-                .put(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),"onTableInsert");
-        tagTable.getActionMap().put("onTableInsert",addAction);
-
-        // unassign some standard shortcuts for JTable to allow upload / download / image browsing
-        InputMapUtils.unassignCtrlShiftUpDown(tagTable, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-        InputMapUtils.unassignPageUpDown(tagTable, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-
-        // unassign some standard shortcuts for correct copy-pasting, fix #8508
-        tagTable.setTransferHandler(null);
-
-        tagTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
-                .put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),"onCopy");
-        tagTable.getActionMap().put("onCopy",copyKeyValueAction);
-
-        // allow using enter to add tags for all look&feel configurations
-        InputMapUtils.enableEnter(this.btnAdd);
-
-        // DEL button = deleteAction
-        getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
-                KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),"delete"
-                );
-        getActionMap().put("delete", deleteAction);
-
-        // F1 button = custom help action
-        getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
-                KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), "onHelp");
-        getActionMap().put("onHelp", helpAction);
     }
 
@@ -515,9 +161,4 @@
         Relation relation = (Relation)membershipData.getValueAt(row, 0);
         Main.map.relationListDialog.selectRelation(relation);
-        RelationEditor.getEditor(
-                Main.main.getEditLayer(),
-                relation,
-                ((MemberInfo) membershipData.getValueAt(row, 1)).role
-        ).setVisible(true);
     }
 
@@ -543,49 +184,5 @@
 
     @Override
-    public void showNotify() {
-        DatasetEventManager.getInstance().addDatasetListener(dataChangedAdapter, FireMode.IN_EDT_CONSOLIDATED);
-        SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED);
-        MapView.addEditLayerChangeListener(this);
-        for (JosmAction action : josmActions) {
-            Main.registerActionShortcut(action);
-        }
-        updateSelection();
-    }
-
-    @Override
-    public void hideNotify() {
-        DatasetEventManager.getInstance().removeDatasetListener(dataChangedAdapter);
-        SelectionEventManager.getInstance().removeSelectionListener(this);
-        MapView.removeEditLayerChangeListener(this);
-        for (JosmAction action : josmActions) {
-            Main.unregisterActionShortcut(action);
-        }
-    }
-
-    @Override
-    public void setVisible(boolean b) {
-        super.setVisible(b);
-        if (b && Main.main.getCurrentDataSet() != null) {
-            updateSelection();
-        }
-    }
-
-    @Override
-    public void destroy() {
-        super.destroy();
-        Main.pref.removePreferenceChangeListener(this);
-        for (JosmAction action : josmActions) {
-            action.destroy();
-        }
-        Container parent = pluginHook.getParent();
-        if (parent != null) {
-            parent.remove(pluginHook);
-        }
-    }
-
-    @Override
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-        if (!isVisible())
-            return;
         if (tagTable == null)
             return; // selection changed may be received in base class constructor before init
@@ -613,26 +210,6 @@
         tagData.setRowCount(0);
 
-        final boolean displayDiscardableKeys = Main.pref.getBoolean("display.discardable-keys", false);
-        final Map<String, Integer> keyCount = new HashMap<>();
         final Map<String, String> tags = new HashMap<>();
         valueCount.clear();
-        Set<TaggingPresetType> types = EnumSet.noneOf(TaggingPresetType.class);
-        for (OsmPrimitive osm : newSel) {
-            types.add(TaggingPresetType.forPrimitive(osm));
-            for (String key : osm.keySet()) {
-                if (displayDiscardableKeys || !OsmPrimitive.getDiscardableKeys().contains(key)) {
-                    String value = osm.get(key);
-                    keyCount.put(key, keyCount.containsKey(key) ? keyCount.get(key) + 1 : 1);
-                    if (valueCount.containsKey(key)) {
-                        Map<String, Integer> v = valueCount.get(key);
-                        v.put(value, v.containsKey(value) ? v.get(value) + 1 : 1);
-                    } else {
-                        Map<String, Integer> v = new TreeMap<>();
-                        v.put(value, 1);
-                        valueCount.put(key, v);
-                    }
-                }
-            }
-        }
         for (Entry<String, Map<String, Integer>> e : valueCount.entrySet()) {
             int count = 0;
@@ -683,6 +260,4 @@
         }
 
-        presets.updatePresets(types, tags, presetHandler);
-
         membershipTable.getTableHeader().setVisible(membershipData.getRowCount() > 0);
         membershipTable.setVisible(membershipData.getRowCount() > 0);
@@ -691,31 +266,12 @@
         boolean hasTags = hasSelection && tagData.getRowCount() > 0;
         boolean hasMemberships = hasSelection && membershipData.getRowCount() > 0;
-        
-        //temp commenting out to fix enable button bug
-        
+          
         addAction.setEnabled(hasSelection);
         //editAction.setEnabled(hasTags || hasMemberships);
         editAction.setEnabled(true);
-        deleteAction.setEnabled(hasTags || hasMemberships);
         tagTable.setVisible(hasTags);
         tagTable.getTableHeader().setVisible(hasTags);
         selectSth.setVisible(!hasSelection);
-        pluginHook.setVisible(hasSelection);  
-        
-        //end of commenting out
-        
-        //temp code
-        /*
-        addAction.setEnabled(true);
-        editAction.setEnabled(true);
-        deleteAction.setEnabled(true);       
-  
-        
-        tagTable.setVisible(true);
-        tagTable.getTableHeader().setVisible(true);
-        selectSth.setVisible(false);
-        pluginHook.setVisible(true);
-        */
-       //end of temp code
+        pluginHook.setVisible(hasSelection);          
         
         int selectedIndex;
@@ -729,25 +285,4 @@
             membershipTable.changeSelection(0, 0, false, false);
         }
-
-        if(tagData.getRowCount() != 0 || membershipData.getRowCount() != 0) {
-            setTitle(tr("Tags: {0} / Memberships: {1}",
-                    tagData.getRowCount(), membershipData.getRowCount()));
-        } else {
-            setTitle(tr("Tags / Memberships"));
-        }
-    }
-
-    /* ---------------------------------------------------------------------------------- */
-    /* EditLayerChangeListener                                                            */
-    /* ---------------------------------------------------------------------------------- */
-    @Override
-    public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
-        if (newLayer == null) editHelper.saveTagsIfNeeded();
-        // it is time to save history of tags
-        GuiHelper.runInEDT(new Runnable() {
-            @Override public void run() {
-                updateSelection();
-            }
-        });
     }
 
@@ -761,11 +296,4 @@
     // <editor-fold defaultstate="collapsed" desc="Methods that are called by plugins to extend fuctionality ">
 
-    /**
-     * Replies the tag popup menu handler.
-     * @return The tag popup menu handler
-     */
-    public PopupMenuHandler getPropertyPopupMenuHandler() {
-        return tagMenuHandler;
-    }
 
     /**
@@ -784,12 +312,4 @@
 
     /**
-     * Replies the membership popup menu handler.
-     * @return The membership popup menu handler
-     */
-    public PopupMenuHandler getMembershipPopupMenuHandler() {
-        return membershipMenuHandler;
-    }
-
-    /**
      * Returns the selected relation membership.
      * @return The current selected relation membership
@@ -824,5 +344,5 @@
                 } else {
                     editHelper.addTag();
-                    btnAdd.requestFocusInWindow();
+                    //btnAdd.requestFocusInWindow();
                 }
             } else if (e.getSource() == membershipTable) {
@@ -833,5 +353,5 @@
             } else {
                 editHelper.addTag();
-                btnAdd.requestFocusInWindow();
+                //btnAdd.requestFocusInWindow();
             }
         }
@@ -913,115 +433,4 @@
         public Class<?> getColumnClass(int columnIndex) {
             return String.class;
-        }
-    }
-
-    /**
-     * Action handling delete button press in properties dialog.
-     */
-    class DeleteAction extends JosmAction implements ListSelectionListener {
-
-        private static final String DELETE_FROM_RELATION_PREF = "delete_from_relation";
-
-        DeleteAction() {
-            super(tr("Delete"), /* ICON() */ "dialogs/delete", tr("Delete the selected key in all objects"),
-                    Shortcut.registerShortcut("properties:delete", tr("Delete Tags"), KeyEvent.VK_D,
-                            Shortcut.ALT_CTRL_SHIFT), false);
-            updateEnabledState();
-        }
-
-        protected void deleteTags(int[] rows){
-            // convert list of rows to HashMap (and find gap for nextKey)
-            Map<String, String> tags = new HashMap<>(rows.length);
-            int nextKeyIndex = rows[0];
-            for (int row : rows) {
-                String key = tagData.getValueAt(row, 0).toString();
-                if (row == nextKeyIndex + 1) {
-                    nextKeyIndex = row; // no gap yet
-                }
-                tags.put(key, null);
-            }
-
-            // find key to select after deleting other tags
-            String nextKey = null;
-            int rowCount = tagData.getRowCount();
-            if (rowCount > rows.length) {
-                if (nextKeyIndex == rows[rows.length-1]) {
-                    // no gap found, pick next or previous key in list
-                    nextKeyIndex = (nextKeyIndex + 1 < rowCount ? nextKeyIndex + 1 : rows[0] - 1);
-                } else {
-                    // gap found
-                    nextKeyIndex++;
-                }
-                nextKey = (String)tagData.getValueAt(nextKeyIndex, 0);
-            }
-
-            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
-            Main.main.undoRedo.add(new ChangePropertyCommand(sel, tags));
-
-            membershipTable.clearSelection();
-            if (nextKey != null) {
-                tagTable.changeSelection(findRow(tagData, nextKey), 0, false, false);
-            }
-        }
-
-        protected void deleteFromRelation(int row) {
-            Relation cur = (Relation)membershipData.getValueAt(row, 0);
-
-            Relation nextRelation = null;
-            int rowCount = membershipTable.getRowCount();
-            if (rowCount > 1) {
-                nextRelation = (Relation) membershipData.getValueAt(row + 1 < rowCount ? row + 1 : row - 1, 0);
-            }
-
-            ExtendedDialog ed = new ExtendedDialog(Main.parent,
-                    tr("Change relation"),
-                    new String[] {tr("Delete from relation"), tr("Cancel")});
-            ed.setButtonIcons(new String[] {"dialogs/delete", "cancel"});
-            ed.setContent(tr("Really delete selection from relation {0}?", cur.getDisplayName(DefaultNameFormatter.getInstance())));
-            ed.toggleEnable(DELETE_FROM_RELATION_PREF);
-            ed.showDialog();
-
-            if(ed.getValue() != 1)
-                return;
-
-            Relation rel = new Relation(cur);
-            for (OsmPrimitive primitive: Main.main.getInProgressSelection()) {
-                rel.removeMembersFor(primitive);
-            }
-            Main.main.undoRedo.add(new ChangeCommand(cur, rel));
-
-            tagTable.clearSelection();
-            if (nextRelation != null) {
-                membershipTable.changeSelection(findRow(membershipData, nextRelation), 0, false, false);
-            }
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            if (tagTable.getSelectedRowCount() > 0) {
-                int[] rows = tagTable.getSelectedRows();
-                deleteTags(rows);
-            } else if (membershipTable.getSelectedRowCount() > 0) {
-                ConditionalOptionPaneUtil.startBulkOperation(DELETE_FROM_RELATION_PREF);
-                int[] rows = membershipTable.getSelectedRows();
-                // delete from last relation to conserve row numbers in the table
-                for (int i=rows.length-1; i>=0; i--) {
-                    deleteFromRelation(rows[i]);
-                }
-                ConditionalOptionPaneUtil.endBulkOperation(DELETE_FROM_RELATION_PREF);
-            }
-        }
-
-        @Override
-        protected final void updateEnabledState() {
-            setEnabled(
-                    (tagTable != null && tagTable.getSelectedRowCount() >= 1)
-                    || (membershipTable != null && membershipTable.getSelectedRowCount() > 0)
-                    );
-        }
-
-        @Override
-        public void valueChanged(ListSelectionEvent e) {
-            updateEnabledState();
         }
     }
@@ -1088,258 +497,3 @@
         }
     }
-
-    class HelpAction extends AbstractAction {
-        HelpAction() {
-            putValue(NAME, tr("Go to OSM wiki for tag help (F1)"));
-            putValue(SHORT_DESCRIPTION, tr("Launch browser with wiki help for selected object"));
-            putValue(SMALL_ICON, ImageProvider.get("dialogs", "search"));
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            try {
-                String base = Main.pref.get("url.openstreetmap-wiki", "http://wiki.openstreetmap.org/wiki/");
-                String lang = LanguageInfo.getWikiLanguagePrefix();
-                final List<URI> uris = new ArrayList<>();
-                int row;
-                if (tagTable.getSelectedRowCount() == 1) {
-                    row = tagTable.getSelectedRow();
-                    String key = Utils.encodeUrl(tagData.getValueAt(row, 0).toString());
-                    @SuppressWarnings("unchecked")
-                    Map<String, Integer> m = (Map<String, Integer>) tagData.getValueAt(row, 1);
-                    String val = Utils.encodeUrl(m.entrySet().iterator().next().getKey());
-
-                    uris.add(new URI(String.format("%s%sTag:%s=%s", base, lang, key, val)));
-                    uris.add(new URI(String.format("%sTag:%s=%s", base, key, val)));
-                    uris.add(new URI(String.format("%s%sKey:%s", base, lang, key)));
-                    uris.add(new URI(String.format("%sKey:%s", base, key)));
-                    uris.add(new URI(String.format("%s%sMap_Features", base, lang)));
-                    uris.add(new URI(String.format("%sMap_Features", base)));
-                } else if (membershipTable.getSelectedRowCount() == 1) {
-                    row = membershipTable.getSelectedRow();
-                    String type = ((Relation)membershipData.getValueAt(row, 0)).get("type");
-                    if (type != null) {
-                        type = Utils.encodeUrl(type);
-                    }
-
-                    if (type != null && !type.isEmpty()) {
-                        uris.add(new URI(String.format("%s%sRelation:%s", base, lang, type)));
-                        uris.add(new URI(String.format("%sRelation:%s", base, type)));
-                    }
-
-                    uris.add(new URI(String.format("%s%sRelations", base, lang)));
-                    uris.add(new URI(String.format("%sRelations", base)));
-                } else {
-                    // give the generic help page, if more than one element is selected
-                    uris.add(new URI(String.format("%s%sMap_Features", base, lang)));
-                    uris.add(new URI(String.format("%sMap_Features", base)));
-                }
-
-                Main.worker.execute(new Runnable(){
-                    @Override public void run() {
-                        try {
-                            // find a page that actually exists in the wiki
-                            HttpURLConnection conn;
-                            for (URI u : uris) {
-                                conn = Utils.openHttpConnection(u.toURL());
-                                conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
-
-                                if (conn.getResponseCode() != 200) {
-                                    Main.info("{0} does not exist", u);
-                                    conn.disconnect();
-                                } else {
-                                    int osize = conn.getContentLength();
-                                    if (osize > -1) {
-                                        conn.disconnect();
-
-                                        conn = Utils.openHttpConnection(new URI(u.toString()
-                                                .replace("=", "%3D") /* do not URLencode whole string! */
-                                                .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=")
-                                                ).toURL());
-                                        conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
-                                    }
-
-                                    /* redirect pages have different content length, but retrieving a "nonredirect"
-                                     *  page using index.php and the direct-link method gives slightly different
-                                     *  content lengths, so we have to be fuzzy.. (this is UGLY, recode if u know better)
-                                     */
-                                    if (conn.getContentLength() != -1 && osize > -1 && Math.abs(conn.getContentLength() - osize) > 200) {
-                                        Main.info("{0} is a mediawiki redirect", u);
-                                        conn.disconnect();
-                                    } else {
-                                        Main.info("browsing to {0}", u);
-                                        conn.disconnect();
-
-                                        OpenBrowser.displayUrl(u.toString());
-                                        break;
-                                    }
-                                }
-                            }
-                        } catch (Exception e) {
-                            Main.error(e);
-                        }
-                    }
-                });
-            } catch (URISyntaxException e1) {
-                Main.error(e1);
-            }
-        }
-    }
-
-    class PasteValueAction extends AbstractAction {
-        PasteValueAction() {
-            putValue(NAME, tr("Paste Value"));
-            putValue(SHORT_DESCRIPTION, tr("Paste the value of the selected tag from clipboard"));
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent ae) {
-            if (tagTable.getSelectedRowCount() != 1)
-                return;
-            String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
-            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
-            String clipboard = Utils.getClipboardContent();
-            if (sel.isEmpty() || clipboard == null)
-                return;
-            Main.main.undoRedo.add(new ChangePropertyCommand(sel, key, Utils.strip(clipboard)));
-        }
-    }
-
-    abstract class AbstractCopyAction extends AbstractAction {
-
-        protected abstract Collection<String> getString(OsmPrimitive p, String key);
-
-        @Override
-        public void actionPerformed(ActionEvent ae) {
-            int[] rows = tagTable.getSelectedRows();
-            Set<String> values = new TreeSet<>();
-            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
-            if (rows.length == 0 || sel.isEmpty()) return;
-
-            for (int row: rows) {
-                String key = tagData.getValueAt(row, 0).toString();
-                if (sel.isEmpty())
-                    return;
-                for (OsmPrimitive p : sel) {
-                    Collection<String> s = getString(p,key);
-                    if (s != null) {
-                        values.addAll(s);
-                    }
-                }
-            }
-            if (!values.isEmpty()) {
-                Utils.copyToClipboard(Utils.join("\n", values));
-            }
-        }
-    }
-
-    class CopyValueAction extends AbstractCopyAction {
-
-        /**
-         * Constructs a new {@code CopyValueAction}.
-         */
-        CopyValueAction() {
-            putValue(NAME, tr("Copy Value"));
-            putValue(SHORT_DESCRIPTION, tr("Copy the value of the selected tag to clipboard"));
-        }
-
-        @Override
-        protected Collection<String> getString(OsmPrimitive p, String key) {
-            String v = p.get(key);
-            return v == null ? null : Collections.singleton(v);
-        }
-    }
-
-    class CopyKeyValueAction extends AbstractCopyAction {
-
-        CopyKeyValueAction() {
-            putValue(NAME, tr("Copy selected Key(s)/Value(s)"));
-            putValue(SHORT_DESCRIPTION, tr("Copy the key and value of the selected tag(s) to clipboard"));
-        }
-
-        @Override
-        protected Collection<String> getString(OsmPrimitive p, String key) {
-            String v = p.get(key);
-            return v == null ? null : Collections.singleton(new Tag(key, v).toString());
-        }
-    }
-
-    class CopyAllKeyValueAction extends AbstractCopyAction {
-
-        CopyAllKeyValueAction() {
-            putValue(NAME, tr("Copy all Keys/Values"));
-            putValue(SHORT_DESCRIPTION, tr("Copy the key and value of all the tags to clipboard"));
-        }
-
-        @Override
-        protected Collection<String> getString(OsmPrimitive p, String key) {
-            List<String> r = new LinkedList<>();
-            for (Entry<String, String> kv : p.getKeys().entrySet()) {
-                r.add(new Tag(kv.getKey(), kv.getValue()).toString());
-            }
-            return r;
-        }
-    }
-
-    class SearchAction extends AbstractAction {
-        private final boolean sameType;
-
-        SearchAction(boolean sameType) {
-            this.sameType = sameType;
-            if (sameType) {
-                putValue(NAME, tr("Search Key/Value/Type"));
-                putValue(SHORT_DESCRIPTION, tr("Search with the key and value of the selected tag, restrict to type (i.e., node/way/relation)"));
-            } else {
-                putValue(NAME, tr("Search Key/Value"));
-                putValue(SHORT_DESCRIPTION, tr("Search with the key and value of the selected tag"));
-            }
-        }
-
-        @Override
-        public void actionPerformed(ActionEvent e) {
-            if (tagTable.getSelectedRowCount() != 1)
-                return;
-            String key = tagData.getValueAt(tagTable.getSelectedRow(), 0).toString();
-            Collection<OsmPrimitive> sel = Main.main.getInProgressSelection();
-            if (sel.isEmpty())
-                return;
-            String sep = "";
-            StringBuilder s = new StringBuilder();
-            for (OsmPrimitive p : sel) {
-                String val = p.get(key);
-                if (val == null) {
-                    continue;
-                }
-                String t = "";
-                if (!sameType) {
-                    t = "";
-                } else if (p instanceof Node) {
-                    t = "type:node ";
-                } else if (p instanceof Way) {
-                    t = "type:way ";
-                } else if (p instanceof Relation) {
-                    t = "type:relation ";
-                }
-                s.append(sep).append('(').append(t).append('"').append(
-                        org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(key)).append("\"=\"").append(
-                        org.openstreetmap.josm.actions.search.SearchAction.escapeStringForSearch(val)).append("\")");
-                sep = " OR ";
-            }
-
-            final SearchSetting ss = new SearchSetting();
-            ss.text = s.toString();
-            ss.mode = SearchMode.replace;
-            ss.caseSensitive = true;
-            org.openstreetmap.josm.actions.search.SearchAction.searchWithoutHistory(ss);
-        }
-    }
-
-    @Override
-    public void preferenceChanged(PreferenceChangeEvent e) {
-        super.preferenceChanged(e);
-        if ("display.discardable-keys".equals(e.getKey()) && Main.main.getCurrentDataSet() != null) {
-            // Re-load data when display preference change
-            updateSelection();
-        }
-    }
 }
