Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 12846)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 12847)
@@ -56,9 +56,9 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.preferences.AbstractPreferences;
+import org.openstreetmap.josm.spi.preferences.AbstractPreferences;
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.data.preferences.ColorProperty;
 import org.openstreetmap.josm.data.preferences.DoubleProperty;
-import org.openstreetmap.josm.data.preferences.IPreferences;
+import org.openstreetmap.josm.spi.preferences.IPreferences;
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
 import org.openstreetmap.josm.data.preferences.ListListSetting;
Index: trunk/src/org/openstreetmap/josm/data/preferences/AbstractPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/AbstractPreferences.java	(revision 12846)
+++ 	(revision )
@@ -1,124 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.preferences;
-
-import java.util.List;
-import java.util.Map;
-
-import org.openstreetmap.josm.tools.Logging;
-
-/**
- * Abstract implementation of the {@link IPreferences} interface.
- * @since 12840
- */
-public abstract class AbstractPreferences implements IPreferences {
-
-    @Override
-    public synchronized String get(final String key, final String def) {
-        return getSetting(key, new StringSetting(def), StringSetting.class).getValue();
-    }
-
-    @Override
-    public boolean put(final String key, String value) {
-        return putSetting(key, value == null || value.isEmpty() ? null : new StringSetting(value));
-    }
-
-    @Override
-    public boolean getBoolean(final String key, final boolean def) {
-        return Boolean.parseBoolean(get(key, Boolean.toString(def)));
-    }
-
-    @Override
-    public boolean putBoolean(final String key, final boolean value) {
-        return put(key, Boolean.toString(value));
-    }
-
-    @Override
-    public synchronized int getInt(String key, int def) {
-        String v = get(key, Integer.toString(def));
-        if (v.isEmpty())
-            return def;
-
-        try {
-            return Integer.parseInt(v);
-        } catch (NumberFormatException e) {
-            // fall out
-            Logging.trace(e);
-        }
-        return def;
-    }
-
-    @Override
-    public boolean putInt(String key, int value) {
-        return put(key, Integer.toString(value));
-    }
-
-    @Override
-    public synchronized double getDouble(String key, double def) {
-        String v = get(key, Double.toString(def));
-        if (null == v)
-            return def;
-
-        try {
-            return Double.parseDouble(v);
-        } catch (NumberFormatException e) {
-            // fall out
-            Logging.trace(e);
-        }
-        return def;
-    }
-
-    @Override
-    public boolean putDouble(final String key, final double value) {
-        return put(key, Double.toString(value));
-    }
-
-    @Override
-    public List<String> getList(String key, List<String> def) {
-        return getSetting(key, new ListSetting(def), ListSetting.class).getValue();
-    }
-
-    @Override
-    public boolean putList(String key, List<String> value) {
-        return putSetting(key, value == null ? null : new ListSetting(value));
-    }
-
-    @Override
-    public List<List<String>> getListOfLists(String key, List<List<String>> def) {
-        return getSetting(key, new ListListSetting(def), ListListSetting.class).getValue();
-    }
-
-    @Override
-    public boolean putListOfLists(String key, List<List<String>> value) {
-        return putSetting(key, value == null ? null : new ListListSetting(value));
-    }
-
-    @Override
-    public List<Map<String, String>> getListOfMaps(String key, List<Map<String, String>> def) {
-        return getSetting(key, new MapListSetting(def), MapListSetting.class).getValue();
-    }
-
-    @Override
-    public boolean putListOfMaps(String key, List<Map<String, String>> value) {
-        return putSetting(key, value == null ? null : new MapListSetting(value));
-    }
-
-    /**
-     * Set a value for a certain setting. The changed setting is saved to the preference file immediately.
-     * Due to caching mechanisms on modern operating systems and hardware, this shouldn't be a performance problem.
-     * @param key the unique identifier for the setting
-     * @param setting the value of the setting. In case it is null, the key-value entry will be removed.
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     */
-    public abstract boolean putSetting(String key, Setting<?> setting);
-
-    /**
-     * Get settings value for a certain key and provide default a value.
-     * @param <T> the setting type
-     * @param key the identifier for the setting
-     * @param def the default value. For each call of getSetting() with a given key, the default value must be the same.
-     * <code>def</code> must not be null, but the value of <code>def</code> can be null.
-     * @param klass the setting type (same as T)
-     * @return the corresponding value if the property has been set before, {@code def} otherwise
-     */
-    public abstract <T extends Setting<?>> T getSetting(String key, T def, Class<T> klass);
-}
Index: trunk/src/org/openstreetmap/josm/data/preferences/IPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/IPreferences.java	(revision 12846)
+++ 	(revision )
@@ -1,222 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.preferences;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
-
-/**
- * Interface for preference handling.
- *
- * Allows to save and retrieve user defined settings. The backend storage depends
- * on the implementation.
- * @since 12840
- */
-public interface IPreferences {
-
-    /**
-     * Adds a new preferences listener.
-     * @param listener The listener to add
-     */
-    void addPreferenceChangeListener(PreferenceChangedListener listener);
-
-    /**
-     * Removes a preferences listener.
-     * @param listener The listener to remove
-     */
-    void removePreferenceChangeListener(PreferenceChangedListener listener);
-
-    /**
-     * Adds a listener that only listens to changes in one preference
-     * @param key The preference key to listen to
-     * @param listener The listener to add.
-     */
-    void addKeyPreferenceChangeListener(String key, PreferenceChangedListener listener);
-
-    /**
-     * Removes a listener that only listens to changes in one preference
-     * @param key The preference key to listen to
-     * @param listener The listener to add.
-     */
-    void removeKeyPreferenceChangeListener(String key, PreferenceChangedListener listener);
-
-    /**
-     * Get settings value for a certain key and provide a default value.
-     * @param key the identifier for the setting
-     * @param def the default value. For each call of get() with a given key, the
-     * default value must be the same. {@code def} may be null.
-     * @return the corresponding value if the property has been set before, {@code def} otherwise
-     */
-    String get(String key, String def);
-
-    /**
-     * Get settings value for a certain key.
-     * @param key the identifier for the setting
-     * @return "" if there is nothing set for the preference key, the corresponding value otherwise. The result is not null.
-     */
-    default String get(final String key) {
-        return get(key, "");
-    }
-
-    /**
-     * Set a value for a certain setting.
-     * @param key the unique identifier for the setting
-     * @param value the value of the setting. Can be null or "" which both removes the key-value entry.
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     */
-    boolean put(String key, String value);
-
-    /**
-     * Gets a boolean preference
-     * @param key The preference key
-     * @param def The default value to use
-     * @return The boolean, <code>false</code> if it could not be parsed, the default value if it is unset
-     */
-    boolean getBoolean(String key, boolean def);
-
-    /**
-     * Gets a boolean preference
-     * @param key The preference key
-     * @return The boolean or <code>false</code> if it could not be parsed
-     */
-    default boolean getBoolean(String key) {
-        return getBoolean(key, false);
-    }
-
-    /**
-     * Set a boolean value for a certain setting.
-     * @param key the unique identifier for the setting
-     * @param value The new value
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     * @since 12840
-     */
-    boolean putBoolean(String key, boolean value);
-
-    /**
-     * Gets an integer preference
-     * @param key The preference key
-     * @param def The default value to use
-     * @return The integer
-     * @since 12840
-     */
-    int getInt(String key, int def);
-
-    /**
-     * Set a boolean value for a certain setting.
-     * @param key the unique identifier for the setting
-     * @param value The new value
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     * @since 12840
-     */
-    boolean putInt(String key, int value);
-
-    /**
-     * Gets a double preference
-     * @param key The preference key
-     * @param def The default value to use
-     * @return The double value or the default value if it could not be parsed
-     */
-    double getDouble(String key, double def);
-
-    /**
-     * Set a boolean value for a certain setting.
-     * @param key the unique identifier for the setting
-     * @param value The new value
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     * @since 12840
-     */
-    boolean putDouble(String key, double value);
-
-    /**
-     * Get a list of values for a certain key
-     * @param key the identifier for the setting
-     * @param def the default value.
-     * @return the corresponding value if the property has been set before, {@code def} otherwise
-     * @since 12840
-     */
-    List<String> getList(String key, List<String> def);
-
-    /**
-     * Get a list of values for a certain key
-     * @param key the identifier for the setting
-     * @return the corresponding value if the property has been set before, an
-     * empty list otherwise.
-     * @since 12840
-     */
-    default List<String> getList(String key) {
-        List<String> val = getList(key, null);
-        return val == null ? Collections.emptyList() : val;
-    }
-
-    /**
-     * Set a list of values for a certain key.
-     * @param key the identifier for the setting
-     * @param value The new value
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     * @since 12840
-     */
-    boolean putList(String key, List<String> value);
-
-    /**
-     * Get an array of values (list of lists) for a certain key
-     * @param key the identifier for the setting
-     * @param def the default value.
-     * @return the corresponding value if the property has been set before, {@code def} otherwise
-     * @since 12840
-     */
-    List<List<String>> getListOfLists(String key, List<List<String>> def);
-
-    /**
-     * Get an array of values (list of lists) for a certain key
-     * @param key the identifier for the setting
-     * @return the corresponding value if the property has been set before, an
-     * empty list otherwise
-     * @since 12840
-     */
-    default List<List<String>> getListOfLists(String key) {
-        List<List<String>> val = getListOfLists(key, null);
-        return val == null ? Collections.emptyList() : val;
-    }
-
-    /**
-     * Set an array of values (list of lists) for a certain key.
-     * @param key the identifier for the setting
-     * @param value the new value
-     * @return {@code true}, if something has changed (i.e. value is different than before)
-     * @since 12840
-     */
-    boolean putListOfLists(String key, List<List<String>> value);
-
-    /**
-     * Gets a list of key/value maps.
-     * @param key the key to search at
-     * @param def the default value to use
-     * @return the corresponding value if the property has been set before, {@code def} otherwise
-     * @since 12840
-     */
-    List<Map<String, String>> getListOfMaps(String key, List<Map<String, String>> def);
-
-    /**
-     * Gets a list of key/value maps.
-     * @param key the key to search at
-     * @return the corresponding value if the property has been set before, an
-     * empty list otherwise
-     * @since 12840
-     */
-    default List<Map<String, String>> getListOfMaps(String key) {
-        List<Map<String, String>> val = getListOfMaps(key, null);
-        return val == null ? Collections.emptyList() : val;
-    }
-
-    /**
-     * Set an a list of key/value maps.
-     * @param key the key to store the list in
-     * @param value a list of key/value maps
-     * @return <code>true</code> if the value was changed
-     * @since 12840
-     */
-    boolean putListOfMaps(String key, List<Map<String, String>> value);
-
-}
