Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 3855)
@@ -335,5 +335,5 @@
         jb.add(toolBarActions);
 
-        jb.addSeparator(new Dimension(0,10));
+        jb.addSeparator(new Dimension(0,18));
         toolBarToggle.setAlignmentX(0.5f);
         jb.add(toolBarToggle);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 3855)
@@ -7,10 +7,8 @@
 import java.awt.Dimension;
 import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
 
 import javax.swing.AbstractAction;
@@ -20,4 +18,5 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
+import javax.swing.JViewport;
 import javax.swing.ListSelectionModel;
 import javax.swing.SwingUtilities;
@@ -26,10 +25,12 @@
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintStyleLoader;
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
+import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -38,5 +39,5 @@
 public class MapPaintDialog extends ToggleDialog {
 
-    protected JTable tblStyles;
+    protected StylesTable tblStyles;
     protected StylesModel model;
     protected DefaultListSelectionModel selectionModel;
@@ -47,5 +48,5 @@
     public MapPaintDialog() {
         super(tr("Map Paint Styles"), "mapstyle", tr("configure the map painting style"),
-                Shortcut.registerShortcut("subwindow:authors", tr("Toggle: {0}", tr("Authors")), KeyEvent.VK_M, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 250);
+                Shortcut.registerShortcut("subwindow:authors", tr("Toggle: {0}", tr("Authors")), KeyEvent.VK_M, Shortcut.GROUP_LAYER, Shortcut.SHIFT_DEFAULT), 150);
         build();
     }
@@ -56,7 +57,6 @@
 
         model = new StylesModel();
-        model.setStyles(MapPaintStyles.getStyles().getStyleSources());
         
-        tblStyles = new JTable(model);
+        tblStyles = new StylesTable(model);
         tblStyles.setSelectionModel(selectionModel= new DefaultListSelectionModel());
         tblStyles.addMouseListener(new PopupMenuHandler());
@@ -77,19 +77,53 @@
     }
 
+    protected static class StylesTable extends JTable {
+
+        public StylesTable(TableModel dm) {
+            super(dm);
+        }
+
+        public void scrollToVisible(int row, int col) {
+            if (!(getParent() instanceof JViewport))
+                return;
+            JViewport viewport = (JViewport) getParent();
+            Rectangle rect = getCellRect(row, col, true);
+            Point pt = viewport.getViewPosition();
+            rect.setLocation(rect.x - pt.x, rect.y - pt.y);
+            viewport.scrollRectToVisible(rect);
+        }
+    }
+
     protected JPanel buildButtonRow() {
-        JPanel p = getButtonPanel(1);
+        JPanel p = getButtonPanel(4);
         reloadAction = new ReloadAction();
         onoffAction = new OnOffAction();
+        MoveUpDownAction up = new MoveUpDownAction(false);
+        MoveUpDownAction down = new MoveUpDownAction(true);
         selectionModel.addListSelectionListener(onoffAction);
         selectionModel.addListSelectionListener(reloadAction);
+        selectionModel.addListSelectionListener(up);
+        selectionModel.addListSelectionListener(down);
         p.add(new SideButton(onoffAction));
+        p.add(new SideButton(up));
+        p.add(new SideButton(down));
+        p.add(new SideButton(new LaunchMapPaintPreferencesAction()));
+
         return p;
     }
-    
-    protected class StylesModel extends AbstractTableModel {
-        List<StyleSource> data;
-
-        public StylesModel() {
-            this.data = new ArrayList<StyleSource>();
+
+    @Override
+    public void showNotify() {
+        MapPaintStyles.addMapPaintSylesUpdateListener(model);
+    }
+
+    @Override
+    public void hideNotify() {
+        MapPaintStyles.removeMapPaintSylesUpdateListener(model);
+    }
+
+    protected class StylesModel extends AbstractTableModel implements MapPaintSylesUpdateListener {
+
+        private StyleSource getRow(int i) {
+            return MapPaintStyles.getStyles().getStyleSources().get(i);
         }
 
@@ -101,5 +135,5 @@
         @Override
         public int getRowCount() {
-            return data.size();
+            return MapPaintStyles.getStyles().getStyleSources().size();
         }
         
@@ -107,7 +141,7 @@
         public Object getValueAt(int row, int column) {
             if (column == 0)
-                return data.get(row).active;
+                return getRow(row).active;
             else
-                return data.get(row).getDisplayString();
+                return getRow(row).getDisplayString();
         }
 
@@ -129,29 +163,34 @@
                 return;
             if (column == 0) {
-                toggleOnOff(row);
-            }
-        }
-
-        public void setStyles(Collection<? extends StyleSource> styles) {
-            data.clear();
-            if (styles !=null) {
-                data.addAll(styles);
-            }
+                MapPaintStyles.toggleStyleActive(row);
+            }
+        }
+
+        /**
+         * Make sure the first of the selected entry is visible in the
+         * views of this model.
+         */
+        protected void ensureSelectedIsVisible() {
+            int index = selectionModel.getMinSelectionIndex();
+            if (index < 0) return;
+            if (index >= getRowCount()) return;
+            tblStyles.scrollToVisible(index, 0);
+            tblStyles.repaint();
+        }
+
+        /**
+         * MapPaintSylesUpdateListener interface
+         */
+
+        @Override
+        public void mapPaintStylesUpdated() {
             fireTableDataChanged();
-        }
-
-        public void toggleOnOff(int... rows) {
-            for (Integer p : rows) {
-                StyleSource s = model.data.get(p);
-                s.active = !s.active;
-            }
-            if (rows.length == 1) {
-                model.fireTableCellUpdated(rows[0], 0);
-            } else {
-                model.fireTableDataChanged();
-            }
-            MapPaintStyles.getStyles().clearCached();
-            Main.map.mapView.preferenceChanged(null);
-            Main.map.mapView.repaint();
+            tblStyles.repaint();
+        }
+
+        @Override
+        public void mapPaintStyleEntryUpdated(int idx) {
+            fireTableRowsUpdated(idx, idx);
+            tblStyles.repaint();
         }
     }
@@ -176,5 +215,59 @@
         public void actionPerformed(ActionEvent e) {
             int[] pos = tblStyles.getSelectedRows();
-            model.toggleOnOff(pos);
+            MapPaintStyles.toggleStyleActive(pos);
+            selectionModel.clearSelection();
+            for (int p: pos) {
+                selectionModel.addSelectionInterval(p, p);
+            }
+        }
+    }
+
+    /**
+     * The action to move down the currently selected entries in the list.
+     */
+    class MoveUpDownAction extends AbstractAction implements ListSelectionListener {
+        final int increment;
+        public MoveUpDownAction(boolean isDown) {
+            increment = isDown ? 1 : -1;
+            putValue(SMALL_ICON, isDown ? ImageProvider.get("dialogs", "down") : ImageProvider.get("dialogs", "up"));
+            putValue(SHORT_DESCRIPTION, isDown ? tr("Move the selected entry one row down.") : tr("Move the selected entry one row up."));
+            updateEnabledState();
+        }
+
+        public void updateEnabledState() {
+            int[] sel = tblStyles.getSelectedRows();
+            setEnabled(MapPaintStyles.canMoveStyles(sel, increment));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            int[] sel = tblStyles.getSelectedRows();
+            MapPaintStyles.moveStyles(sel, increment);
+
+            selectionModel.clearSelection();
+            for (int row: sel) {
+                selectionModel.addSelectionInterval(row + increment, row + increment);
+            }
+            model.ensureSelectedIsVisible();
+        }
+
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();
+        }
+    }
+    
+    /**
+     * Opens preferences window and selects the mappaint tab.
+     */
+    class LaunchMapPaintPreferencesAction extends AbstractAction {
+        public LaunchMapPaintPreferencesAction() {
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "mappaintpreference"));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            final PreferenceDialog p =new PreferenceDialog(Main.parent);
+            p.selectMapPaintPreferenceTab();
+            p.setVisible(true);
         }
     }
@@ -192,5 +285,5 @@
             boolean e = pos.length > 0;
             for (int i : pos) {
-                if (!model.data.get(i).isLocal()) {
+                if (!model.getRow(i).isLocal()) {
                     e = false;
                     break;
@@ -207,11 +300,6 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-
             final int[] rows = tblStyles.getSelectedRows();
-            List<StyleSource> sources = new ArrayList<StyleSource>();
-            for (int p : rows) {
-                sources.add(model.data.get(p));
-            }
-            Main.worker.submit(new MapPaintStyleLoader(sources));
+            MapPaintStyles.reloadStyles(rows);
             Main.worker.submit(new Runnable() {
                 @Override
@@ -220,14 +308,11 @@
                         @Override
                         public void run() {
-                            if (rows.length == 1) {
-                                model.fireTableCellUpdated(rows[0], 1);
-                            } else {
-                                model.fireTableDataChanged();
+                            selectionModel.clearSelection();
+                            for (int r: rows) {
+                                selectionModel.addSelectionInterval(r, r);
                             }
-                            MapPaintStyles.getStyles().clearCached();
-                            Main.map.mapView.preferenceChanged(null);
-                            Main.map.mapView.repaint();
                         }
                     });
+
                 }
             });
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 3855)
@@ -35,10 +35,6 @@
     }
 
-    public void add(StyleSource style) {
-        styleSources.add(style);
-    }
-
-    public Collection<StyleSource> getStyleSources() {
-        return Collections.<StyleSource>unmodifiableCollection(styleSources);
+    public List<StyleSource> getStyleSources() {
+        return Collections.<StyleSource>unmodifiableList(styleSources);
     }
 
@@ -241,3 +237,26 @@
         this.drawMultipolygon = drawMultipolygon;
     }
+
+    /**
+     * remove all style sources; only accessed from MapPaintStyles
+     */
+    void clear() {
+        styleSources.clear();
+    }
+
+    /**
+     * add a style source; only accessed from MapPaintStyles
+     */
+    void add(StyleSource style) {
+        styleSources.add(style);
+    }
+
+    /**
+     * set the style sources; only accessed from MapPaintStyles
+     */
+    void setStyleSources(Collection<StyleSource> sources) {
+        styleSources.clear();
+        styleSources.addAll(sources);
+    }
+
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 3855)
@@ -6,10 +6,14 @@
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 import javax.swing.ImageIcon;
+import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
@@ -23,4 +27,11 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 
+/**
+ * This class manages the ElemStyles instance. The object you get with
+ * getStyles() is read only, any manipulation happens via one of
+ * the wrapper methods here. (readFromPreferences, moveStyles, ...)
+ *
+ * On change, mapPaintSylesUpdated() is fired for all listeners.
+ */
 public class MapPaintStyles {
 
@@ -71,6 +82,6 @@
     }
 
-    @SuppressWarnings("null")
     public static void readFromPreferences() {
+        styles.clear();
         iconDirs = Main.pref.getCollection("mappaint.icon.sources", Collections.<String>emptySet());
         if(Main.pref.getBoolean("mappaint.icon.enable-defaults", true))
@@ -83,5 +94,5 @@
         }
 
-        Collection<? extends SourceEntry> sourceEntries = (new MapPaintPrefMigration()).get();
+        Collection<? extends SourceEntry> sourceEntries = MapPaintPrefMigration.INSTANCE.get();
 
         for (SourceEntry entry : sourceEntries) {
@@ -120,4 +131,19 @@
             s.loadStyleSource();
         }
+        fireMapPaintSylesUpdated();
+    }
+
+    /**
+     * reload styles
+     * preferences are the same, but the file source may have changed
+     * @param sel the indices of styles to reload
+     */
+    public static void reloadStyles(final int... sel) {
+        List<StyleSource> toReload = new ArrayList<StyleSource>();
+        List<StyleSource> data = styles.getStyleSources();
+        for (int i : sel) {
+            toReload.add(data.get(i));
+        }
+        Main.worker.submit(new MapPaintStyleLoader(toReload));
     }
 
@@ -138,4 +164,13 @@
         @Override
         protected void finish() {
+            SwingUtilities.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                    fireMapPaintSylesUpdated();
+                    styles.clearCached();
+                    Main.map.mapView.preferenceChanged(null);
+                    Main.map.mapView.repaint();
+                }
+            });
         }
 
@@ -154,3 +189,93 @@
     }
 
+    /**
+     * Move position of entries in the current list of StyleSources
+     * @param sele The indices of styles to be moved.
+     * @param delta The number of lines it should move. positive int moves
+     *      down and negative moves up.
+     */
+    public static void moveStyles(int[] sel, int delta) {
+        if (!canMoveStyles(sel, delta))
+            return;
+        int[] selSorted = Arrays.copyOf(sel, sel.length);
+        Arrays.sort(selSorted);
+        List<StyleSource> data = new ArrayList<StyleSource>(styles.getStyleSources());
+        for (int row: selSorted) {
+            StyleSource t1 = data.get(row);
+            StyleSource t2 = data.get(row + delta);
+            data.set(row, t2);
+            data.set(row + delta, t1);
+        }
+        styles.setStyleSources(data);
+        MapPaintPrefMigration.INSTANCE.put(data);
+        fireMapPaintSylesUpdated();
+        styles.clearCached();
+        Main.map.mapView.repaint();
+    }
+
+    public static boolean canMoveStyles(int[] sel, int i) {
+        if (sel.length == 0)
+            return false;
+        int[] selSorted = Arrays.copyOf(sel, sel.length);
+        Arrays.sort(selSorted);
+
+        if (i < 0) { // Up
+            return selSorted[0] >= -i;
+        } else
+        if (i > 0) { // Down
+            return selSorted[selSorted.length-1] <= styles.getStyleSources().size() - 1 - i;
+        } else
+            return true;
+    }
+
+    public static void toggleStyleActive(int... sel) {
+        List<StyleSource> data = styles.getStyleSources();
+        for (int p : sel) {
+            StyleSource s = data.get(p);
+            s.active = !s.active;
+        }
+        MapPaintPrefMigration.INSTANCE.put(data);
+        if (sel.length == 1) {
+            fireMapPaintStyleEntryUpdated(sel[0]);
+        } else {
+            fireMapPaintSylesUpdated();
+        }
+        styles.clearCached();
+        Main.map.mapView.repaint();
+    }
+
+    /***********************************
+     * MapPaintSylesUpdateListener & related code
+     *  (get informed when the list of MapPaint StyleSources changes)
+     */
+
+    public interface MapPaintSylesUpdateListener {
+        public void mapPaintStylesUpdated();
+        public void mapPaintStyleEntryUpdated(int idx);
+    }
+
+    protected static final CopyOnWriteArrayList<MapPaintSylesUpdateListener> listeners
+            = new CopyOnWriteArrayList<MapPaintSylesUpdateListener>();
+
+    public static void addMapPaintSylesUpdateListener(MapPaintSylesUpdateListener listener) {
+        if (listener != null) {
+            listeners.addIfAbsent(listener);
+        }
+    }
+
+    public static void removeMapPaintSylesUpdateListener(MapPaintSylesUpdateListener listener) {
+        listeners.remove(listener);
+    }
+
+    public static void fireMapPaintSylesUpdated() {
+        for (MapPaintSylesUpdateListener l : listeners) {
+            l.mapPaintStylesUpdated();
+        }
+    }
+
+    public static void fireMapPaintStyleEntryUpdated(int idx) {
+        for (MapPaintSylesUpdateListener l : listeners) {
+            l.mapPaintStyleEntryUpdated(idx);
+        }
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3855)
@@ -97,5 +97,5 @@
                 }
             }
-        } else if (primitive instanceof Relation) {
+        } else if (primitive instanceof Relation && icon != null) {
             painter.drawRestriction((Relation) primitive, this);
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3855)
@@ -41,4 +41,5 @@
     public void loadStyleSource() {
         rules.clear();
+        hasError = false;
         try {
             MirroredInputStream in = new MirroredInputStream(url);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3855)
@@ -50,4 +50,5 @@
 
     protected void init() {
+        hasError = false;
         icons.clear();
         lines.clear();
Index: trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java	(revision 3855)
@@ -68,10 +68,10 @@
 
         public MapPaintSourceEditor() {
-            super("http://josm.openstreetmap.de/styles");
+            super(true, "http://josm.openstreetmap.de/styles");
         }
 
         @Override
         public Collection<? extends SourceEntry> getInitialSourcesList() {
-            return (new MapPaintPrefMigration()).get();
+            return MapPaintPrefMigration.INSTANCE.get();
         }
 
@@ -80,5 +80,5 @@
             List<SourceEntry> activeStyles = activeSourcesModel.getSources();
 
-            boolean changed = (new MapPaintPrefMigration()).put(activeStyles);
+            boolean changed = MapPaintPrefMigration.INSTANCE.put(activeStyles);
 
             if (tblIconPaths != null) {
@@ -98,5 +98,5 @@
         @Override
         public Collection<ExtendedSourceEntry> getDefault() {
-            return (new MapPaintPrefMigration()).getDefault();
+            return MapPaintPrefMigration.INSTANCE.getDefault();
         }
 
@@ -143,16 +143,14 @@
 
     public boolean ok() {
-        Boolean restart = false;
-        if(Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected())) {
-            restart = true;
+        boolean reload = Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected());
+        reload |= sources.finish();
+        if (reload) {
+            MapPaintStyles.readFromPreferences();
         }
-        if(sources.finish()) {
-            restart = true;
-        }
-        if(Main.isDisplayingMapView())
+        if (Main.isDisplayingMapView())
         {
             MapPaintStyles.getStyles().clearCached();
         }
-        return restart;
+        return false;
     }
 
@@ -165,4 +163,6 @@
 
     public static class MapPaintPrefMigration extends SourceEditor.SourcePrefMigration {
+
+        public final static MapPaintPrefMigration INSTANCE = new MapPaintPrefMigration();
 
         public MapPaintPrefMigration() {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 3855)
@@ -131,3 +131,8 @@
         }
     }
+
+    public void selectMapPaintPreferenceTab() {
+        tpPreferences.setSelectedComponent(tpPreferences.map);
+        tpPreferences.mapcontent.setSelectedIndex(1);
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 3855)
@@ -12,4 +12,5 @@
 import java.awt.GridBagLayout;
 import java.awt.Insets;
+import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.FocusAdapter;
@@ -43,4 +44,5 @@
 import javax.swing.DefaultListSelectionModel;
 import javax.swing.JButton;
+import javax.swing.JCheckBox;
 import javax.swing.JComponent;
 import javax.swing.JFileChooser;
@@ -81,4 +83,6 @@
 public abstract class SourceEditor extends JPanel {
 
+    final protected boolean isMapPaint;
+    
     protected JTable tblActiveSources;
     protected ActiveSourcesModel activeSourcesModel;
@@ -92,8 +96,11 @@
     /**
      * constructor
+     * @param isMapPaint true for MapPaintPreference subclass, false
+     *  for TaggingPresetPreference subclass
      * @param availableSourcesUrl the URL to the list of available sources
      */
-    public SourceEditor(final String availableSourcesUrl) {
-
+    public SourceEditor(final boolean isMapPaint, final String availableSourcesUrl) {
+
+        this.isMapPaint = isMapPaint;
         DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
         lstAvailableSources = new JList(availableSourcesModel = new AvailableSourcesListModel(selectionModel));
@@ -103,5 +110,11 @@
 
         selectionModel = new DefaultListSelectionModel();
-        tblActiveSources = new JTable(activeSourcesModel = new ActiveSourcesModel(selectionModel));
+        tblActiveSources = new JTable(activeSourcesModel = new ActiveSourcesModel(selectionModel)) {
+            // some kind of hack to prevent the table from scrolling slightly to the
+            // right when clicking on the text
+            public void scrollRectToVisible(Rectangle aRect) {
+                super.scrollRectToVisible(new Rectangle(0, aRect.y, aRect.width, aRect.height));
+            }
+        };
         tblActiveSources.putClientProperty("terminateEditOnFocusLost", true);
         tblActiveSources.setSelectionModel(selectionModel);
@@ -112,5 +125,12 @@
         tblActiveSources.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
         SourceEntryTableCellRenderer sourceEntryRenderer = new SourceEntryTableCellRenderer();
-        tblActiveSources.getColumnModel().getColumn(0).setCellRenderer(sourceEntryRenderer);
+        if (isMapPaint) {
+            tblActiveSources.getColumnModel().getColumn(0).setMaxWidth(1);
+            tblActiveSources.getColumnModel().getColumn(0).setResizable(false);
+            tblActiveSources.getColumnModel().getColumn(1).setCellRenderer(sourceEntryRenderer);
+        } else {
+            tblActiveSources.getColumnModel().getColumn(0).setCellRenderer(sourceEntryRenderer);
+        }
+
         activeSourcesModel.addTableModelListener(new TableModelListener() {
             // Force swing to show horizontal scrollbars for the JTable
@@ -118,5 +138,5 @@
             @Override
             public void tableChanged(TableModelEvent e) {
-                adjustColumnWidth(tblActiveSources, 0);
+                adjustColumnWidth(tblActiveSources, isMapPaint ? 1 : 0);
             }
         });
@@ -130,5 +150,8 @@
                 if (e.getClickCount() == 2) {
                     int row = tblActiveSources.rowAtPoint(e.getPoint());
+                    int col = tblActiveSources.columnAtPoint(e.getPoint());
                     if (row < 0 || row >= tblActiveSources.getRowCount())
+                        return;
+                    if (isMapPaint  && col != 1)
                         return;
                     editActiveSourceAction.actionPerformed(null);
@@ -141,4 +164,15 @@
         tblActiveSources.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), "delete");
         tblActiveSources.getActionMap().put("delete", removeActiveSourcesAction);
+
+        MoveUpDownAction moveUp = null;
+        MoveUpDownAction moveDown = null;
+        if (isMapPaint) {
+            moveUp = new MoveUpDownAction(false);
+            moveDown = new MoveUpDownAction(true);
+            tblActiveSources.getSelectionModel().addListSelectionListener(moveUp);
+            tblActiveSources.getSelectionModel().addListSelectionListener(moveDown);
+            activeSourcesModel.addTableModelListener(moveUp);
+            activeSourcesModel.addTableModelListener(moveDown);
+        }
 
         ActivateSourcesAction activateSourcesAction = new ActivateSourcesAction();
@@ -209,4 +243,9 @@
         sideButtonTB.add(editActiveSourceAction);
         sideButtonTB.add(removeActiveSourcesAction);
+        sideButtonTB.addSeparator(new Dimension(12, 30));
+        if (isMapPaint) {
+            sideButtonTB.add(moveUp);
+            sideButtonTB.add(moveDown);
+        }
         add(sideButtonTB, gbc);
 
@@ -435,5 +474,5 @@
     }
 
-    protected static class ActiveSourcesModel extends AbstractTableModel {
+    protected class ActiveSourcesModel extends AbstractTableModel {
         private List<SourceEntry> data;
         private DefaultListSelectionModel selectionModel;
@@ -445,5 +484,5 @@
 
         public int getColumnCount() {
-            return 1;
+            return isMapPaint ? 2 : 1;
         }
 
@@ -453,16 +492,30 @@
 
         @Override
-        public SourceEntry getValueAt(int rowIndex, int columnIndex) {
-            return data.get(rowIndex);
+        public Object getValueAt(int rowIndex, int columnIndex) {
+            if (isMapPaint && columnIndex == 0)
+                return data.get(rowIndex).active;
+            else
+                return data.get(rowIndex);
         }
 
         @Override
         public boolean isCellEditable(int rowIndex, int columnIndex) {
-            return false;
-        }
+            return isMapPaint && columnIndex == 0;
+        }
+
+        Class<?>[] columnClasses = {Boolean.class, SourceEntry.class};
 
         @Override
-        public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
-            updateSource(rowIndex, (String)aValue);
+        public Class<?> getColumnClass(int column) {
+            return isMapPaint ? columnClasses[column] : SourceEntry.class;
+        }
+
+        @Override
+        public void setValueAt(Object aValue, int row, int column) {
+            if (row < 0 || row >= getRowCount() || aValue == null)
+                return;
+            if (isMapPaint && column == 0) {
+                data.get(row).active = ! data.get(row).active;
+            }
         }
 
@@ -470,5 +523,7 @@
             data.clear();
             if (sources != null) {
-                data.addAll(sources);
+                for (SourceEntry e : sources) {
+                    data.add(new SourceEntry(e));
+                }
             }
             fireTableDataChanged();
@@ -485,15 +540,4 @@
         }
 
-        public void updateSource(int pos, String src) {
-            if (src == null) return;
-            if (pos < 0 || pos >= getRowCount()) return;
-            data.get(pos).url = src;
-            fireTableDataChanged();
-            int idx = data.indexOf(src);
-            if (idx >= 0) {
-                selectionModel.setSelectionInterval(idx, idx);
-            }
-        }
-
         public void removeSelected() {
             Iterator<SourceEntry> it = data.iterator();
@@ -538,4 +582,31 @@
             return new ArrayList<SourceEntry>(data);
         }
+
+        public boolean canMove(int i) {
+            int[] sel = tblActiveSources.getSelectedRows();
+            if (sel.length == 0)
+                return false;
+            if (i < 0) { // Up
+                return sel[0] >= -i;
+            } else if (i > 0) { // Down
+                return sel[sel.length-1] <= getRowCount()-1 - i;
+            } else
+                return true;
+        }
+
+        public void move(int i) {
+            if (!canMove(i)) return;
+            int[] sel = tblActiveSources.getSelectedRows();
+            for (int row: sel) {
+                SourceEntry t1 = data.get(row);
+                SourceEntry t2 = data.get(row + i);
+                data.set(row, t2);
+                data.set(row + i, t1);
+            }
+            selectionModel.clearSelection();
+            for (int row: sel) {
+                selectionModel.addSelectionInterval(row + i, row + i);
+            }
+        }
     }
 
@@ -590,4 +661,5 @@
         private JTextField tfName;
         private JTextField tfURL;
+        private JCheckBox cbActive;
 
         public EditSourceEntryDialog(Component parent, String title, SourceEntry e) {
@@ -604,8 +676,8 @@
             tfURL = new JTextField(60);
             p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0));
-            p.add(tfURL, GBC.std().insets(0, 0, 5, 0));
+            p.add(tfURL, GBC.std().insets(0, 0, 5, 5));
             JButton fileChooser = new JButton(new LaunchFileChooserAction());
             fileChooser.setMargin(new Insets(0, 0, 0, 0));
-            p.add(fileChooser, GBC.eol().insets(0, 0, 5, 0));
+            p.add(fileChooser, GBC.eol().insets(0, 0, 5, 5));
 
             if (e != null) {
@@ -616,4 +688,8 @@
             }
 
+            if (isMapPaint) {
+                cbActive = new JCheckBox(tr("active"), e != null ? e.active : true);
+                p.add(cbActive, GBC.eol().insets(15, 0, 5, 0));
+            }
             setButtonIcons(new String[] {"ok", "cancel"});
             setContent(p);
@@ -669,4 +745,10 @@
             return tfURL.getText();
         }
+
+        public boolean active() {
+            if (!isMapPaint)
+                throw new UnsupportedOperationException();
+            return cbActive.isSelected();
+        }
     }
 
@@ -685,7 +767,11 @@
             editEntryDialog.showDialog();
             if (editEntryDialog.getValue() == 1) {
+                boolean active = true;
+                if (isMapPaint) {
+                    active = editEntryDialog.active();
+                }
                 activeSourcesModel.addSource(new SourceEntry(
                         editEntryDialog.getURL(),
-                        null, editEntryDialog.getShortdescription(), true));
+                        null, editEntryDialog.getShortdescription(), active));
                 activeSourcesModel.fireTableDataChanged();
             }
@@ -736,5 +822,5 @@
                 return;
 
-            SourceEntry e = activeSourcesModel.getValueAt(pos, 0);
+            SourceEntry e = (SourceEntry) activeSourcesModel.getValueAt(pos, 1);
 
             EditSourceEntryDialog editEntryDialog = new EditSourceEntryDialog(
@@ -749,6 +835,39 @@
                 }
                 e.url = editEntryDialog.getURL();
-                activeSourcesModel.fireTableCellUpdated(pos, 0);
-            }
+                if (isMapPaint) {
+                    e.active = editEntryDialog.active();
+                }
+                activeSourcesModel.fireTableRowsUpdated(pos, pos);
+            }
+        }
+    }
+
+    /**
+     * The action to move the currently selected entries up or down in the list.
+     */
+    class MoveUpDownAction extends AbstractAction implements ListSelectionListener, TableModelListener {
+        final int increment;
+        public MoveUpDownAction(boolean isDown) {
+            increment = isDown ? 1 : -1;
+            putValue(SMALL_ICON, isDown ? ImageProvider.get("dialogs", "down") : ImageProvider.get("dialogs", "up"));
+            putValue(SHORT_DESCRIPTION, isDown ? tr("Move the selected entry one row down.") : tr("Move the selected entry one row up."));
+            updateEnabledState();
+        }
+
+        public void updateEnabledState() {
+            setEnabled(activeSourcesModel.canMove(increment));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            activeSourcesModel.move(increment);
+        }
+
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();
+        }
+
+        public void tableChanged(TableModelEvent e) {
+            updateEnabledState();
         }
     }
@@ -1107,5 +1226,5 @@
             }
             s.append(entry.url);
-            if (entry.name != null) {
+            if (entry.shortdescription != null) {
                 s.append(")");
             }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEntry.java	(revision 3855)
@@ -46,4 +46,11 @@
         this.shortdescription = equal(shortdescription, "") ? null : shortdescription;
         this.active = active;
+    }
+
+    public SourceEntry(SourceEntry e) {
+        this.url = e.url;
+        this.name = e.name;
+        this.shortdescription = e.shortdescription;
+        this.active = e.active;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 3854)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/TaggingPresetPreference.java	(revision 3855)
@@ -166,10 +166,10 @@
 
         public TaggingPresetSourceEditor() {
-            super("http://josm.openstreetmap.de/presets");
+            super(false, "http://josm.openstreetmap.de/presets");
         }
 
         @Override
         public Collection<? extends SourceEntry> getInitialSourcesList() {
-            return (new PresetPrefMigration()).get();
+            return PresetPrefMigration.INSTANCE.get();
         }
 
@@ -178,5 +178,5 @@
             List<SourceEntry> activeStyles = activeSourcesModel.getSources();
 
-            boolean changed = (new PresetPrefMigration()).put(activeStyles);
+            boolean changed = PresetPrefMigration.INSTANCE.put(activeStyles);
 
             if (tblIconPaths != null) {
@@ -196,5 +196,5 @@
         @Override
         public Collection<ExtendedSourceEntry> getDefault() {
-            return (new PresetPrefMigration()).getDefault();
+            return PresetPrefMigration.INSTANCE.getDefault();
         }
 
@@ -291,4 +291,6 @@
     public static class PresetPrefMigration extends SourceEditor.SourcePrefMigration {
 
+        public final static PresetPrefMigration INSTANCE = new PresetPrefMigration();
+
         public PresetPrefMigration() {
             super("taggingpreset.sources",
