Index: applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26603)
+++ applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/OpenPageAction.java	(revision 26624)
@@ -55,5 +55,10 @@
             p=sel.iterator().next();
         } else {
-            showConfigDialog();
+            JOptionPane.showMessageDialog(
+                    Main.parent,
+                    tr("Please select one element to open custom URL for it. You can choose the URL in Preferences, Utils tab."),
+                    tr("Information"),
+                    JOptionPane.INFORMATION_MESSAGE
+            );
             return;
         }
@@ -67,5 +72,4 @@
         try {
         while (m.find()) {
-                System.out.println(m.group());
                 key=m.group(1);
                 if (key.equals("#id")) {
@@ -91,9 +95,7 @@
             return;
         }
-        System.out.println(i);
         for (int j=0;j<i;j++){
             addr = addr.replace(keys[j],vals[j]);
         }
-        System.out.println(addr);
         try {
             OpenBrowser.displayUrl(addr);
@@ -120,43 +122,3 @@
         setEnabled(selection != null );
     }
-
-    private void showConfigDialog() {
-        JPanel all = new JPanel();
-        GridBagLayout layout = new GridBagLayout();
-        all.setLayout(layout);
-        
-        HistoryComboBox combo1=new HistoryComboBox();
-        
-        // FIXME: get rid of hardcoded URLS
-        ArrayList<String> items=new ArrayList<String>();
-        items.add(defaultURL);
-        items.add("http://latlon.org/buildings?zoom=17&lat={#lat}&lon={#lon}&layers=B");
-        items.add("http://addresses.amdmi3.ru/?zoom=11&lat={#lat}&lon={#lon}&layers=B00");
-        items.add("http://www.openstreetmap.org/browse/{#type}/{#id}/history");
-        items.add("http://www.openstreetmap.org/browse/{#type}/{#id}");
-        String addr = Main.pref.get("utilsplugin2.customurl", defaultURL);
-        System.out.println("pref:"+addr);
-        combo1.setPossibleItems(items);
-        
-        HtmlPanel help = new HtmlPanel(tr("You can open custom URL for <b>one</b> selected object<br/>"
-                + " <b>&#123;key&#125;</b> is replaced with the tag walue<br/>"
-                + " <b>&#123;#id&#125;</b> is replaced with the element ID<br/>"
-                + " <b>&#123;#type&#125;</b> is replaced with \"node\",\"way\" or \"relation\" <br/>"
-                + " <b>&#123;#lat&#125; , &#123;#lon&#125;</b> is replaced with element latitude/longitude"));
-        help.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
-        all.add(help,GBC.eop().insets(5,10,0,0));
-        all.add(combo1,GBC.eop().insets(5,10,0,0));
-        
-        ExtendedDialog dialog = new ExtendedDialog(Main.parent,
-                tr("Configure custom URL"),
-                new String[] {tr("OK"),tr("Cancel"),}
-        );
-        dialog.setContent(all, false);
-        dialog.setButtonIcons(new String[] {"ok.png","cancel.png",});
-        dialog.setDefaultButton(1);
-        dialog.showDialog();
-        
-        addr=combo1.getText();
-        if (dialog.getValue() ==1 && addr.length()>6) Main.pref.put("utilsplugin2.customurl",addr);
-    }
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java	(revision 26603)
+++ applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java	(revision 26624)
@@ -2,4 +2,5 @@
 package utilsplugin2;
 
+import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
 import java.awt.event.KeyEvent;
 import javax.swing.JMenu;
@@ -102,3 +103,8 @@
         undoSelection.setEnabled(enabled);
     }
+    @Override
+    public PreferenceSetting getPreferenceSetting() {
+        return new UtilsPluginPreferences();
+    }
+
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java	(revision 26624)
+++ applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPluginPreferences.java	(revision 26624)
@@ -0,0 +1,152 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package utilsplugin2;
+
+import java.util.List;
+import javax.swing.table.TableModel;
+import javax.swing.JTable;
+import javax.swing.JLabel;
+import java.awt.GridBagLayout;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.event.TableModelEvent;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import java.awt.GridBagConstraints;
+import javax.swing.JPanel;
+import javax.swing.ListSelectionModel;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
+import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
+import org.openstreetmap.josm.tools.GBC;
+
+import static org.openstreetmap.josm.tools.I18n.*;
+
+public class UtilsPluginPreferences  implements PreferenceSetting {
+    private final String defaultURL = "http://ru.wikipedia.org/w/index.php?search={name}&fulltext=Search";
+
+    HistoryComboBox combo1=new HistoryComboBox();
+    JTable table;
+
+    @Override
+    public void addGui(PreferenceTabbedPane gui) {
+        JPanel pp = gui.createPreferenceTab("utils", tr("Utilsplugin2 settings [TESTING]"),
+                tr("Here you can change some preferences of Utilsplugin2 functions"));
+        JPanel all = new JPanel();
+        GridBagLayout layout = new GridBagLayout();
+        all.setLayout(layout);
+        
+        // FIXME: get rid of hardcoded URLS
+        List<String> items = (List<String>) Main.pref.getCollection("utilsplugin2.urlHistory");
+        if (items==null || items.size()==0) {
+            items= new ArrayList<String>();
+            items.add("Wikipedia");
+            items.add("http://en.wikipedia.org/w/index.php?search={name}&fulltext=Search");
+            items.add("Wikipedia RU");
+            items.add(defaultURL);
+            items.add("LatLon buildings");
+            items.add("http://latlon.org/buildings?zoom=17&lat={#lat}&lon={#lon}&layers=B");
+            items.add("AMDMi3 Russian streets");
+            items.add("http://addresses.amdmi3.ru/?zoom=11&lat={#lat}&lon={#lon}&layers=B00");
+            items.add("Element history");
+            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}/history");
+            items.add("Browse element");
+            items.add("http://www.openstreetmap.org/browse/{#type}/{#id}");
+        }
+        String addr = Main.pref.get("utilsplugin2.customurl", defaultURL);
+        //System.out.println("pref:"+addr);
+        
+        table=new JTable(new DefaultTableModel(null,new String[]{"Title","URL"}));
+        fillRows(items);
+        
+        HtmlPanel help = new HtmlPanel(tr("Please edit custom URLs and select one row to use with the tool<br/>"
+                + " <b>&#123;key&#125;</b> is replaced with the tag walue<br/>"
+                + " <b>&#123;#id&#125;</b> is replaced with the element ID<br/>"
+                + " <b>&#123;#type&#125;</b> is replaced with \"node\",\"way\" or \"relation\" <br/>"
+                + " <b>&#123;#lat&#125; , &#123;#lon&#125;</b> is replaced with element latitude/longitude"));
+        //help.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.));
+
+        all.add(new JLabel(tr("Custom URL configuration")),GBC.eop().insets(5,10,0,0));
+        all.add(help,GBC.eop().insets(5,10,0,0));
+        
+        table.getColumnModel().getColumn(0).setPreferredWidth(150);
+        table.getColumnModel().getColumn(0).setMaxWidth(300);
+        table.getColumnModel().getColumn(1).setPreferredWidth(300);
+        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        table.getModel().addTableModelListener(new TableModelListener() {
+            @Override
+            public void tableChanged(TableModelEvent e) {
+                int row = e.getFirstRow();
+                int column = e.getColumn();
+                DefaultTableModel model = (DefaultTableModel)(e.getSource());
+                String columnName = model.getColumnName(column);
+                if (row<0  || column<0) return;
+                String data = (String)model.getValueAt(row, column);
+                if (data!=null && data.length()>0 && row==model.getRowCount()-1) 
+                    model.addRow(new String[]{"",""});
+            }
+        });
+        all.add(table,GBC.eop().fill());
+        
+        pp.add(all, GBC.eol().fill(GridBagConstraints.BOTH));
+    }
+
+    private void fillRows(List<String> items) {
+        int p=0,row=0;
+        String name, url;
+        String data[][] = new String[][] {{"",""}};
+        DefaultTableModel model = (DefaultTableModel) table.getModel();
+        int n=items.size();
+        while (true) {
+            if (p>=n) break;
+            name = items.get(p);
+            //System.out.println("name="+name);
+            p++;
+            if (p>=n) break;
+            url = items.get(p);
+            //System.out.println("url="+url);
+            p++;
+            model.addRow(new String[]{name,url});
+            row++;
+        }
+        model.addRow(new String[]{"",""});
+    }
+
+    @Override
+    public boolean ok() {
+        String addr=combo1.getText();
+        TableModel model = (table.getModel());
+        String v;
+        ArrayList<String> lst=new ArrayList<String>();
+        int n=model.getRowCount();
+        for (int i=0;i<n;i++) {
+            v=(String) model.getValueAt(i, 0);
+            if (v.length()==0) continue;
+            lst.add(v);
+            v=(String) model.getValueAt(i, 1);
+            lst.add(v);
+        }
+        Main.pref.putCollection("utilsplugin2.urlHistory",lst);
+        int row=table.getSelectedRow();
+        if (row!=-1) {
+            v=(String) model.getValueAt(row, 1);
+            Main.pref.put("utilsplugin2.customurl",v);
+        }
+        
+        try {
+            Main.pref.save();
+        } catch (IOException ex) {
+            Logger.getLogger(UtilsPluginPreferences.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        return false;
+    }
+
+    
+}
