Index: trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 1180)
@@ -19,9 +19,4 @@
     public DiskAccessAction(String name, String iconName, String tooltip, Shortcut shortcut) {
         super(name, iconName, tooltip, shortcut, true);
-    }
-
-    @Deprecated
-    public DiskAccessAction(String name, String iconName, String tooltip, int shortcut, int modifiers) {
-        super(name, iconName, tooltip, shortcut, modifiers, true);
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 1180)
@@ -25,6 +25,4 @@
 abstract public class JosmAction extends AbstractAction implements Destroyable {
 
-    @Deprecated
-    public KeyStroke shortcut;
     protected Shortcut sc;
 
@@ -36,26 +34,4 @@
         }
         return sc;
-    }
-
-    @Deprecated
-    public JosmAction(String name, String iconName, String tooltip, int shortcut, int modifier, boolean register) {
-        super(name, iconName == null ? null : ImageProvider.get(iconName));
-        setHelpId();
-        if (shortcut != 0) {
-            int group = Shortcut.GROUP_LAYER; //GROUP_NONE;
-            if (((modifier & InputEvent.CTRL_MASK) != 0) || ((modifier & InputEvent.CTRL_DOWN_MASK) != 0)) {
-                group = Shortcut.GROUP_MENU;
-            } else if (modifier == 0) {
-                group = Shortcut.GROUP_EDIT;
-            }
-            sc = Shortcut.registerShortcut("auto:"+name, name, shortcut, group);
-            this.shortcut = sc.getKeyStroke();
-            Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
-            Main.contentPane.getActionMap().put(name, this);
-        }
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
-        putValue("toolbar", iconName);
-    if (register)
-        Main.toolbar.register(this);
     }
 
@@ -80,5 +56,4 @@
         sc = shortcut;
         if (sc != null) {
-            this.shortcut = sc.getKeyStroke();
             Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), name);
             Main.contentPane.getActionMap().put(name, this);
@@ -91,5 +66,5 @@
 
     public void destroy() {
-        if (shortcut != null) {
+        if (sc != null) {
             Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(sc.getKeyStroke());
             Main.contentPane.getActionMap().remove(sc.getKeyStroke());
Index: trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1180)
@@ -30,10 +30,4 @@
     public SaveActionBase(String name, String iconName, String tooltip, Shortcut shortcut, Layer layer) {
         super(name, iconName, tooltip, shortcut);
-        this.layer = layer;
-    }
-
-    @Deprecated
-    public SaveActionBase(String name, String iconName, String tooltip, int shortcut, int modifiers, Layer layer) {
-        super(name, iconName, tooltip, shortcut, modifiers);
         this.layer = layer;
     }
Index: trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java	(revision 1180)
@@ -24,16 +24,4 @@
     }
 
-    @Deprecated
-    public AudioFastSlowAction(String name, String iconName, String tooltip, int shortcut, int modifier, boolean fast) {
-        super(name, iconName, tooltip, shortcut, modifier, true);
-        try {
-            multiplier = Double.parseDouble(Main.pref.get("audio.fastfwdmultiplier","1.3"));
-        } catch (NumberFormatException e) {
-            multiplier = 1.3;
-        }
-        if (! fast)
-            multiplier = 1.0 / multiplier;
-    }
-
     public void actionPerformed(ActionEvent e) {
         double speed = AudioPlayer.speed();
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java	(revision 1180)
@@ -31,14 +31,4 @@
     public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) {
         super(name, "mapmode/"+iconName, tooltip, shortcut, false);
-        this.cursor = cursor;
-        putValue("active", false);
-    }
-
-    /**
-     * Constructor for mapmodes without an menu
-     */
-     @Deprecated
-    public MapMode(String name, String iconName, String tooltip, int keystroke, MapFrame mapFrame, Cursor cursor) {
-        super(name, "mapmode/"+iconName, tooltip, keystroke, 0, false);
         this.cursor = cursor;
         putValue("active", false);
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 1180)
@@ -208,5 +208,5 @@
     }
 
-    synchronized public void put(final String key, String value) {
+    synchronized public boolean put(final String key, String value) {
         String oldvalue = properties.get(key);
         if(value != null && value.length() == 0)
@@ -221,9 +221,19 @@
             save();
             firePreferenceChanged(key, value);
-        }
-    }
-
-    synchronized public void put(final String key, final boolean value) {
-        put(key, Boolean.toString(value));
+            return true;
+        }
+        return false;
+    }
+
+    synchronized public boolean put(final String key, final boolean value) {
+        return put(key, Boolean.toString(value));
+    }
+
+    synchronized public boolean putInteger(final String key, final Integer value) {
+        return put(key, Integer.toString(value));
+    }
+
+    synchronized public boolean putDouble(final String key, final Double value) {
+        return put(key, Double.toString(value));
     }
 
@@ -343,11 +353,4 @@
     }
 
-    // only for compatibility. Don't use any more.
-    @Deprecated
-    public static Color getPreferencesColor(String colName, Color def)
-    {
-        return Main.pref.getColor(colName, def);
-    }
-
     /**
      * Convenience method for accessing colour preferences.
@@ -372,6 +375,6 @@
     }
 
-    synchronized public void putColor(String colName, Color val) {
-        put("color."+colName, val != null ? ColorHelper.color2html(val) : null);
+    synchronized public boolean putColor(String colName, Color val) {
+        return put("color."+colName, val != null ? ColorHelper.color2html(val) : null);
     }
 
@@ -431,7 +434,5 @@
                 return Arrays.asList(s.split(";"));
         }
-        else if(def != null)
-            return def;
-        return null;
+        return def;
     }
     synchronized public void removeFromCollection(String key, String value) {
@@ -443,5 +444,5 @@
         }
     }
-    synchronized public void putCollection(String key, Collection<String> val) {
+    synchronized public boolean putCollection(String key, Collection<String> val) {
         String s = null;
         if(val != null)
@@ -456,5 +457,5 @@
         }
 
-        put(key, s);
+        return put(key, s);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 1180)
@@ -103,16 +103,4 @@
             relations.add((Relation) osm);
         }
-    }
-
-    /**
-     * Remove the selection of the whole dataset.
-     * @deprecated Use {@link #setSelected(Collection) setSelected} instead.
-     */
-    @Deprecated public void clearSelection() {
-        clearSelection(nodes);
-        clearSelection(ways);
-        clearSelection(relations);
-        Collection<OsmPrimitive> sel = Collections.emptyList();
-        fireSelectionChanged(sel);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 1180)
@@ -117,8 +117,3 @@
         return name;
     }
-
-    @Deprecated
-    public boolean isIncomplete() {
-        return incomplete;
-    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 1180)
@@ -144,7 +144,8 @@
      * handled by the OS are not duplicated on the menu.
      */
-    public static void add(JMenu menu, JosmAction action) {
+    public static JMenuItem add(JMenu menu, JosmAction action) {
+        JMenuItem menuitem = null;
         if (!action.getShortcut().getAutomatic()) {
-            JMenuItem menuitem = menu.add(action);
+            menuitem = menu.add(action);
             KeyStroke ks = action.getShortcut().getKeyStroke();
             if (ks != null) {
@@ -152,4 +153,5 @@
             }
         }
+        return menuitem;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 1180)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.actions.mapmode.SelectAction;
 import org.openstreetmap.josm.actions.mapmode.ZoomAction;
+import org.openstreetmap.josm.gui.ScrollViewport;
 import org.openstreetmap.josm.gui.dialogs.CommandStackDialog;
 import org.openstreetmap.josm.gui.dialogs.ConflictDialog;
@@ -52,6 +53,6 @@
      * instead of adding directly to this list. To add a new mode use addMapMode.
      */
-    public JToolBar toolBarActions = new JToolBar(JToolBar.VERTICAL);
-    public JToolBar toolBarToggle = new JToolBar(JToolBar.VERTICAL);
+    private JToolBar toolBarActions = new JToolBar(JToolBar.VERTICAL);
+    private JToolBar toolBarToggle = new JToolBar(JToolBar.VERTICAL);
     /**
      * The status line below the map
@@ -145,5 +146,5 @@
      * @param dlg The toggle dialog. It must not be in the list already.
      */
-    public void addToggleDialog(ToggleDialog dlg) {
+    public IconToggleButton addToggleDialog(ToggleDialog dlg) {
         IconToggleButton button = new IconToggleButton(dlg.action);
         dlg.action.button = button;
@@ -151,4 +152,5 @@
         toolBarToggle.add(button);
         toggleDialogs.add(dlg);
+        return button;
     }
 
@@ -197,5 +199,6 @@
         jb.addSeparator();
         jb.add(toolBarToggle);
-        panel.add(jb, BorderLayout.WEST);
+        panel.add(new ScrollViewport(jb, ScrollViewport.VERTICAL_DIRECTION),
+        BorderLayout.WEST);
         if (statusLine != null)
             panel.add(statusLine, BorderLayout.SOUTH);
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 1180)
@@ -57,15 +57,4 @@
 
     /**
-     * Interface to notify listeners of the change of the active layer.
-     * @author imi
-     * @deprecated Use Layer.LayerChangeListener instead
-     */
-    @Deprecated public interface LayerChangeListener {
-        void activeLayerChange(Layer oldLayer, Layer newLayer);
-        void layerAdded(Layer newLayer);
-        void layerRemoved(Layer oldLayer);
-    }
-
-    /**
      * A list of all layers currently loaded.
      */
@@ -92,10 +81,4 @@
 
     private BufferedImage offscreenBuffer;
-
-    /**
-     * The listener of the active layer changes.
-     * @deprecated Use Layer.listener instead.
-     */
-    @Deprecated private Collection<LayerChangeListener> listeners = new LinkedList<LayerChangeListener>();
 
     public MapView() {
@@ -180,7 +163,4 @@
         layers.add(pos, layer);
 
-        // TODO: Deprecated
-        for (LayerChangeListener l : listeners)
-            l.layerAdded(layer);
         for (Layer.LayerChangeListener l : Layer.listeners)
             l.layerAdded(layer);
@@ -214,7 +194,4 @@
     public void removeLayer(Layer layer) {
         if (layers.remove(layer)) {
-            // TODO: Deprecated
-            for (LayerChangeListener l : listeners)
-                l.layerRemoved(layer);
             for (Layer.LayerChangeListener l : Layer.listeners)
                 l.layerRemoved(layer);
@@ -347,23 +324,4 @@
 
     /**
-     * Add a listener for changes of active layer.
-     * @param listener The listener that get added.
-     * @deprecated Use Layer.listener.add instead.
-     */
-    @Deprecated public void addLayerChangeListener(LayerChangeListener listener) {
-        if (listener != null)
-            listeners.add(listener);
-    }
-
-    /**
-     * Remove the listener.
-     * @param listener The listener that get removed from the list.
-     * @deprecated Use Layer.listener.remove instead
-     */
-    @Deprecated public void removeLayerChangeListener(LayerChangeListener listener) {
-        listeners.remove(listener);
-    }
-
-    /**
      * @return An unmodificable list of all layers
      */
@@ -388,7 +346,4 @@
         activeLayer = layer;
         if (old != layer) {
-            // TODO: Deprecated
-            for (LayerChangeListener l : listeners)
-                l.activeLayerChange(old, layer);
             for (Layer.LayerChangeListener l : Layer.listeners)
                 l.activeLayerChange(old, layer);
Index: trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 1180)
+++ trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java	(revision 1180)
@@ -0,0 +1,196 @@
+// License: GPL. Copyright 2007 by Christian Gallioz (aka khris78)
+
+package org.openstreetmap.josm.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JViewport;
+import javax.swing.Timer;
+
+import org.openstreetmap.josm.tools.ImageProvider;
+
+/** A viewport with UP and DOWN arrow buttons, so that the user can make the
+ * content scroll.
+ */
+public class ScrollViewport extends JPanel {
+
+    private static final int NO_SCROLL = 0;
+
+    public static final int UP_DIRECTION = 1;
+    public static final int DOWN_DIRECTION = 2;
+    public static final int LEFT_DIRECTION = 4;
+    public static final int RIGHT_DIRECTION = 8;
+    public static final int VERTICAL_DIRECTION = UP_DIRECTION | DOWN_DIRECTION;
+    public static final int HORIZONTAL_DIRECTION = LEFT_DIRECTION | RIGHT_DIRECTION;
+    public static final int ALL_DIRECTION = HORIZONTAL_DIRECTION | VERTICAL_DIRECTION;
+
+    private class ScrollViewPortMouseListener extends MouseAdapter {
+        private int direction;
+
+        public ScrollViewPortMouseListener(int direction) {
+            this.direction = direction;
+        }
+
+        @Override public void mouseExited(MouseEvent arg0) {
+            ScrollViewport.this.scrollDirection = NO_SCROLL;
+            timer.stop();
+        }
+
+        @Override public void mouseReleased(MouseEvent arg0) {
+            ScrollViewport.this.scrollDirection = NO_SCROLL;
+            timer.stop();
+        }
+
+        @Override public void mousePressed(MouseEvent arg0) {
+            ScrollViewport.this.scrollDirection = direction;
+            scroll();
+            timer.restart();
+        }
+
+    }
+
+    private JViewport vp = new JViewport();
+    private JComponent component = null;
+
+    private Timer timer = new Timer(200, new ActionListener() {
+        public void actionPerformed(ActionEvent arg0) {
+            ScrollViewport.this.scroll();
+        }
+    });
+
+    private int scrollDirection = NO_SCROLL;
+
+    public ScrollViewport(JComponent c, int direction) {
+        this(direction);
+        add(c);
+    }
+
+    public ScrollViewport(int direction) {
+        setLayout(new BorderLayout());
+
+        JButton button;
+
+        // UP
+        if ((direction & UP_DIRECTION) > 0) {
+            button = new JButton();
+            button.addMouseListener(new ScrollViewPortMouseListener(UP_DIRECTION));
+            button.setPreferredSize(new Dimension(10,10));
+            button.setIcon(ImageProvider.get("svpUp"));
+            add(button, BorderLayout.NORTH);
+        }
+
+        // DOWN
+        if ((direction & DOWN_DIRECTION) > 0) {
+            button = new JButton();
+            button.addMouseListener(new ScrollViewPortMouseListener(DOWN_DIRECTION));
+            button.setPreferredSize(new Dimension(10,10));
+            button.setIcon(ImageProvider.get("svpDown"));
+            add(button, BorderLayout.SOUTH);
+        }
+
+        // LEFT
+        if ((direction & LEFT_DIRECTION) > 0) {
+            button = new JButton();
+            button.addMouseListener(new ScrollViewPortMouseListener(LEFT_DIRECTION));
+            button.setPreferredSize(new Dimension(10,10));
+            button.setIcon(ImageProvider.get("svpLeft"));
+            add(button, BorderLayout.WEST);
+        }
+
+        // RIGHT
+        if ((direction & RIGHT_DIRECTION) > 0) {
+            button = new JButton();
+            button.addMouseListener(new ScrollViewPortMouseListener(RIGHT_DIRECTION));
+            button.setPreferredSize(new Dimension(10,10));
+            button.setIcon(ImageProvider.get("svpRight"));
+            add(button, BorderLayout.EAST);
+        }
+
+        add(vp, BorderLayout.CENTER);
+
+        timer.setRepeats(true);
+        timer.setInitialDelay(400);
+    }
+
+    public synchronized void scroll() {
+        int direction = scrollDirection;
+
+        if (component == null || direction == NO_SCROLL) {
+            return;
+        }
+
+        Dimension compSize = component.getSize();
+        Rectangle viewRect = vp.getViewRect();
+
+        int delta;
+        int newY = 0;
+        int newX = 0;
+
+        if (direction < LEFT_DIRECTION) {
+            newX = viewRect.x;
+            delta = viewRect.height * 4 / 5;
+        } else {
+            newY = viewRect.y;
+            delta = viewRect.width * 4 / 5;
+        }
+
+        switch (direction) {
+        case UP_DIRECTION :
+            newY = viewRect.y - delta;
+            if (newY < 0) {
+                newY = 0;
+            }
+            break;
+        case DOWN_DIRECTION :
+            newY = viewRect.y + delta;
+            if (newY > compSize.height - viewRect.height) {
+                newY = compSize.height - viewRect.height;
+            }
+            break;
+        case LEFT_DIRECTION :
+            newX = viewRect.x - delta;
+            if (newX < 0) {
+                newX = 0;
+            }
+            break;
+        case RIGHT_DIRECTION :
+            newX = viewRect.x + delta;
+            if (newX > compSize.width - viewRect.width) {
+                newX = compSize.width - viewRect.width;
+            }
+            break;
+        default : 
+            throw new IllegalStateException("Unknown direction : [0]" + direction);
+        }
+
+        vp.setViewPosition(new Point(newX, newY));
+    }
+
+    public Rectangle getViewRect() {
+        return vp.getViewRect();
+    }
+
+    public Dimension getViewSize() {
+        return vp.getViewSize();
+    }
+
+    public Point getViewPosition() {
+        return vp.getViewPosition();
+    }
+
+    public void add(JComponent c) {
+        vp.removeAll();
+        this.component = c;
+        vp.add(c);
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/SideButton.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/SideButton.java	(revision 1180)
@@ -25,11 +25,4 @@
         addActionListener(actionListener);
         setToolTipText(tooltip);
-    }
-    @Deprecated
-    public SideButton(String name, String imagename, String property, String tooltip, int mnemonic, ActionListener actionListener)
-    {
-        super(tr(name), ImageProvider.get("dialogs", imagename));
-        setMnemonic(mnemonic);
-        setup(name, property, tooltip, actionListener);
     }
     public SideButton(String name, String imagename, String property, String tooltip, Shortcut shortcut, ActionListener actionListener)
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 1180)
@@ -61,11 +61,4 @@
     public JPanel parent;
     private final JPanel titleBar = new JPanel(new GridBagLayout());
-
-    @Deprecated
-    public ToggleDialog(final String name, String iconName, String tooltip, int shortcut, int preferredHeight) {
-        super(new BorderLayout());
-        this.prefName = iconName;
-        ToggleDialogInit(name, iconName, tooltip, Shortcut.registerShortcut("auto:"+name, tooltip, shortcut, Shortcut.GROUP_LAYER), preferredHeight);
-    }
 
     public ToggleDialog(final String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java	(revision 1180)
@@ -104,11 +104,4 @@
 
     /**
-     * @deprecated Use Main.main.undoRedo.add(...) instead.
-     */
-    @Deprecated public void add(final Command c) {
-        Main.main.undoRedo.add(c);
-    }
-
-    /**
      * The data behind this layer.
      */
Index: trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/AdvancedPreference.java	(revision 1180)
@@ -134,5 +134,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         for (int i = 0; i < model.getRowCount(); ++i) {
             String value = model.getValueAt(i,1).toString();
@@ -148,4 +148,5 @@
         for (Entry<String, String> e : orig.entrySet())
             Main.pref.put(e.getKey(), null);
+        return false;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/AudioPreference.java	(revision 1180)
@@ -158,5 +158,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put("audio.menuinvisible", ! audioMenuVisible.isSelected());
         Main.pref.put("marker.traceaudio", markerAudioTraceVisible.isSelected());
@@ -171,4 +171,5 @@
         Main.pref.put("audio.leadin", audioLeadIn.getText());
         Main.pref.put("audio.calibration", audioCalibration.getText());
+        return false;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java	(revision 1180)
@@ -175,11 +175,10 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         for (int i = 0; i < colors.getRowCount(); ++i) {
-            String name = (String)colors.getValueAt(i, 0);
-            Color col = (Color)colors.getValueAt(i, 1);
-            Main.pref.put("color." + name, ColorHelper.color2html(col));
+            Main.pref.putColor((String)colors.getValueAt(i, 0), (Color)colors.getValueAt(i, 1));
         }
         org.openstreetmap.josm.gui.layer.OsmDataLayer.createHatchTexture();
+        return false;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java	(revision 1180)
@@ -166,5 +166,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put("draw.rawgps.lines", drawRawGpsLines.isSelected());
         Main.pref.put("draw.rawgps.max-line-length", drawRawGpsMaxLineLength.getText());
@@ -184,5 +184,6 @@
         if(virtualNodes.isSelected()) { if (vn < 1) vn = 8; }
         else { vn = 0; }
-        Main.pref.put("mappaint.node.virtual-size", Integer.toString(vn));
+        Main.pref.putInteger("mappaint.node.virtual-size", vn);
+        return false;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/FilePreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/FilePreferences.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/FilePreferences.java	(revision 1180)
@@ -28,6 +28,7 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put("save.keepbackup", keepBackup.isSelected());
+        return false;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java	(revision 1180)
@@ -63,5 +63,4 @@
             }
         });
-        lafCombo.addActionListener(gui.requireRestartAction);
 
         panel = new JPanel(new GridBagLayout());
@@ -89,8 +88,8 @@
     }
 
-    public void ok() {
-        Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName());
+    public boolean ok() {
         Main.pref.put("draw.splashscreen", showSplashScreen.isSelected());
         Main.pref.put("osm-primitives.showid", showID.isSelected());
+        return Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/LanguagePreference.java	(revision 1180)
@@ -53,5 +53,4 @@
             }
         });
-        langCombo.addActionListener(gui.requireRestartAction);
 
         JPanel panel = null;
@@ -67,14 +66,10 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         if(langCombo.getSelectedItem() == null)
-        {
-            Main.pref.put("language", null);
-        }
+            return Main.pref.put("language", null);
         else
-        {
-            String l = ((Locale)langCombo.getSelectedItem()).toString();
-            Main.pref.put("language", l);
-        }
+            return Main.pref.put("language",
+            ((Locale)langCombo.getSelectedItem()).toString());
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 1180)
@@ -10,6 +10,6 @@
     }
 
-    public void ok() {
-        // dummy
+    public boolean ok() {
+        return false; // dummy
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 1180)
@@ -351,5 +351,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Collection<PluginDescription> toDownload = new LinkedList<PluginDescription>();
         String msg = "";
@@ -375,6 +375,5 @@
         }
 
-        String oldPlugins = Main.pref.get("plugins");
-            LinkedList<String> plugins = new LinkedList<String>();
+        LinkedList<String> plugins = new LinkedList<String>();
         Object pd[] = pluginMap.keySet().toArray();
         Arrays.sort(pd);
@@ -384,10 +383,5 @@
         }
 
-        Main.pref.putCollection("plugins", plugins);
-        String newPlugins = Main.pref.get("plugins");
-        if(oldPlugins == null && plugins == null)
-            return;
-        if(plugins == null || oldPlugins == null || !plugins.equals(oldPlugins))
-            gui.requiresRestart = true;
+        return Main.pref.putCollection("plugins", plugins);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 1180)
@@ -35,7 +35,4 @@
 
     public final static Collection<PreferenceSetting> settings = new LinkedList<PreferenceSetting>();
-
-    public boolean requiresRestart = false;
-    public final RequireRestartAction requireRestartAction = new RequireRestartAction();
 
     // some common tabs
@@ -91,15 +88,11 @@
     }
 
-
-
-    private final class RequireRestartAction implements ActionListener {
-        public void actionPerformed(ActionEvent e) {
-            requiresRestart = true;
+    public void ok() {
+        boolean requiresRestart = false;
+        for (PreferenceSetting setting : settings)
+        {
+            if(setting.ok())
+                requiresRestart = true;
         }
-    }
-
-    public void ok() {
-        for (PreferenceSetting setting : settings)
-            setting.ok();
         if (requiresRestart)
             JOptionPane.showMessageDialog(Main.parent,tr("You have to restart JOSM for some settings to take effect."));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java	(revision 1180)
@@ -12,5 +12,6 @@
     /**
      * Called when OK is pressed to save the setting in the preferences file.
+     * Return true when restart is required.
      */
-    void ok();
+    boolean ok();
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java	(revision 1180)
@@ -41,7 +41,4 @@
         }
 
-        projectionCombo.addActionListener(gui.requireRestartAction);
-        coordinatesCombo.addActionListener(gui.requireRestartAction);
-
         JPanel projPanel = new JPanel();
         projPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.gray), tr("Map Projection")));
@@ -56,7 +53,11 @@
     }
 
-    public void ok() {
-        Main.pref.put("projection", projectionCombo.getSelectedItem().getClass().getName());
-        Main.pref.put("coordinates", ((CoordinateFormat)coordinatesCombo.getSelectedItem()).name());
+    public boolean ok() {
+        boolean restart = Main.pref.put("projection",
+        projectionCombo.getSelectedItem().getClass().getName());
+        if(Main.pref.put("coordinates",
+        ((CoordinateFormat)coordinatesCombo.getSelectedItem()).name()))
+            restart = true;
+        return restart;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ProxyPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ProxyPreferences.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ProxyPreferences.java	(revision 1180)
@@ -78,5 +78,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put(PROXY_ENABLE, proxyEnable.isSelected());
         Main.pref.put(PROXY_HOST, proxyHost.getText());
@@ -85,5 +85,5 @@
         Main.pref.put(PROXY_USER, proxyUser.getText());
         Main.pref.put(PROXY_PASS, new String(proxyPass.getPassword()));
+        return false;
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java	(revision 1180)
@@ -51,11 +51,9 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put("osm-server.url", osmDataServer.getText());
         Main.pref.put("osm-server.username", osmDataUsername.getText());
-        String pwd = String.valueOf(osmDataPassword.getPassword());
-        if (pwd.equals(""))
-            pwd = null;
-        Main.pref.put("osm-server.password", pwd);
+        Main.pref.put("osm-server.password", String.valueOf(osmDataPassword.getPassword()));
+        return false;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ShortcutPreference.java	(revision 1180)
@@ -30,6 +30,7 @@
     }
 
-    public void ok() {
-   }
+    public boolean ok() {
+        return false;
+    }
 
     // Maybe move this to prefPanel? There's no need for it to be here.
@@ -89,4 +90,3 @@
         }
     }
-
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 1180)
@@ -8,4 +8,5 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -44,8 +45,8 @@
                 Main.pref.getBoolean("taggingpreset.enable-defaults", true));
 
-        String annos = Main.pref.get("taggingpreset.sources");
-        StringTokenizer st = new StringTokenizer(annos, ";");
-        while (st.hasMoreTokens())
-            ((DefaultListModel)taggingPresetSources.getModel()).addElement(st.nextToken());
+        Collection<String> sources = Main.pref.getCollection("taggingpreset.sources", null);
+        if(sources != null)
+            for(String s : sources)
+                ((DefaultListModel)taggingPresetSources.getModel()).addElement(s);
 
         JButton addAnno = new JButton(tr("Add"));
@@ -53,8 +54,6 @@
             public void actionPerformed(ActionEvent e) {
                 String source = JOptionPane.showInputDialog(Main.parent, tr("Tagging preset source"));
-                if (source == null)
-                    return;
-                ((DefaultListModel)taggingPresetSources.getModel()).addElement(source);
-                gui.requiresRestart = true;
+                if (source != null)
+                    ((DefaultListModel)taggingPresetSources.getModel()).addElement(source);
             }
         });
@@ -67,8 +66,6 @@
                 else {
                     String source = JOptionPane.showInputDialog(Main.parent, tr("Tagging preset source"), taggingPresetSources.getSelectedValue());
-                    if (source == null)
-                        return;
-                    ((DefaultListModel)taggingPresetSources.getModel()).setElementAt(source, taggingPresetSources.getSelectedIndex());
-                    gui.requiresRestart = true;
+                    if (source != null)
+                        ((DefaultListModel)taggingPresetSources.getModel()).setElementAt(source, taggingPresetSources.getSelectedIndex());
                 }
             }
@@ -82,5 +79,4 @@
                 else {
                     ((DefaultListModel)taggingPresetSources.getModel()).remove(taggingPresetSources.getSelectedIndex());
-                    gui.requiresRestart = true;
                 }
             }
@@ -107,13 +103,18 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         Main.pref.put("taggingpreset.enable-defaults", enableDefault.getSelectedObjects() != null);
-        if (taggingPresetSources.getModel().getSize() > 0) {
-            StringBuilder sb = new StringBuilder();
-            for (int i = 0; i < taggingPresetSources.getModel().getSize(); ++i)
-                sb.append(";"+taggingPresetSources.getModel().getElementAt(i));
-            Main.pref.put("taggingpreset.sources", sb.toString().substring(1));
-        } else
-            Main.pref.put("taggingpreset.sources", null);
+        int num = taggingPresetSources.getModel().getSize();
+        boolean restart;
+        if (num > 0)
+        {
+            ArrayList<String> l = new ArrayList<String>();
+            for (int i = 0; i < num; ++i)
+                l.add((String)taggingPresetSources.getModel().getElementAt(i));
+            restart = Main.pref.putCollection("taggingpreset.sources", l);
+        }
+        else
+            restart = Main.pref.putCollection("taggingpreset.sources", null);
+        return restart;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 1179)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 1180)
@@ -234,5 +234,5 @@
     }
 
-    public void ok() {
+    public boolean ok() {
         StringBuilder b = new StringBuilder();
         for (int i = 0; i < selected.size(); ++i) {
@@ -250,4 +250,5 @@
         Main.pref.put("toolbar", s);
         refreshToolbarControl();
+        return false;
     }
 
