Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 5631)
@@ -57,4 +57,8 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.help.Helpful;
+import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
+import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
+import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
+import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.GBC;
@@ -139,4 +143,9 @@
      */
     protected JCheckBoxMenuItem windowMenuItem;
+    
+    /**
+     * The linked preferences class (optional). If set, accessible from the title bar with a dedicated button
+     */
+    protected Class<? extends PreferenceSetting> preferenceClass;
 
     /**
@@ -146,4 +155,11 @@
     public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight) {
         this(name, iconName, tooltip, shortcut, preferredHeight, false);
+    }
+    /**
+     * Constructor
+     * (see below)
+     */
+    public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow) {
+        this(name, iconName, tooltip, shortcut, preferredHeight, defShow, null);
     }
     /**
@@ -156,9 +172,11 @@
      * @param preferredHeight the preferred height for the dialog
      * @param defShow if the dialog should be shown by default, if there is no preference
-     */
-    public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow) {
+     * @param prefClass the preferences settings class, or null if not applicable
+     */
+    public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow, Class<? extends PreferenceSetting> prefClass) {
         super(new BorderLayout());
         this.preferencePrefix = iconName;
         this.name = name;
+        this.preferenceClass = prefClass;
 
         /** Use the full width of the parent element */
@@ -522,4 +540,28 @@
                 add(buttonsHide);
             }
+            
+            // show the pref button if applicable
+            if (preferenceClass != null) {
+                inIcon = ImageProvider.get("preference");
+                smallIcon = new ImageIcon(inIcon.getImage().getScaledInstance(16 , 16, Image.SCALE_SMOOTH));
+                JButton pref = new JButton(smallIcon);
+                pref.setToolTipText(tr("Open preferences for this panel"));
+                pref.setBorder(BorderFactory.createEmptyBorder());
+                pref.addActionListener(
+                        new ActionListener(){
+                            @SuppressWarnings("unchecked")
+                            public void actionPerformed(ActionEvent e) {
+                                final PreferenceDialog p = new PreferenceDialog(Main.parent);
+                                if (TabPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
+                                    p.selectPreferencesTabByClass((Class<? extends TabPreferenceSetting>) preferenceClass);
+                                } else if (SubPreferenceSetting.class.isAssignableFrom(preferenceClass)) {
+                                    p.selectSubPreferencesTabByClass((Class<? extends SubPreferenceSetting>) preferenceClass);
+                                }
+                                p.setVisible(true);
+                            }
+                        }
+                        );
+                add(pref);
+            }
 
             // show the sticky button
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java	(revision 5631)
@@ -2,5 +2,4 @@
 package org.openstreetmap.josm.gui.dialogs;
 
-import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -93,5 +92,5 @@
         super(tr("Validation Results"), "validator", tr("Open the validation window."),
                 Shortcut.registerShortcut("subwindow:validator", tr("Toggle: {0}", tr("Validation results")),
-                        KeyEvent.VK_V, Shortcut.ALT_SHIFT), 150);
+                        KeyEvent.VK_V, Shortcut.ALT_SHIFT), 150, false, ValidatorPreference.class);
 
         popupMenu = new JPopupMenu();
Index: trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/DefaultTabPreferenceSetting.java	(revision 5631)
@@ -2,6 +2,11 @@
 package org.openstreetmap.josm.gui.preferences;
 
+import java.awt.Component;
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
 
 import org.openstreetmap.josm.tools.GBC;
@@ -12,4 +17,6 @@
     private final String description;
     private final String title;
+    private final JTabbedPane tabpane;
+    private final Map<SubPreferenceSetting, Component> subSettingMap;
     
     public DefaultTabPreferenceSetting() {
@@ -22,8 +29,14 @@
 
     public DefaultTabPreferenceSetting(String iconName, String title, String description, boolean isExpert) {
+        this(iconName, title, description, isExpert, null);
+    }
+
+    public DefaultTabPreferenceSetting(String iconName, String title, String description, boolean isExpert, JTabbedPane tabpane) {
         super(isExpert);
         this.iconName = iconName;
         this.description = description;
         this.title = title;
+        this.tabpane = tabpane;
+        this.subSettingMap = tabpane != null ? new HashMap<SubPreferenceSetting, Component>() : null;
     }
 
@@ -51,4 +64,13 @@
         return title;
     }
+
+    /**
+     * Get the inner tab pane, if any.
+     * @return The JTabbedPane contained in this tab preference settings, or null if none is set.
+     * @since 5631
+     */
+    public final JTabbedPane getTabPane() {
+        return tabpane;
+    }
     
     protected final void createPreferenceTabWithScrollPane(PreferenceTabbedPane gui, JPanel panel) {
@@ -63,3 +85,49 @@
         tab.add(GBC.glue(0,10), a);
     }
+
+    @Override
+    public boolean selectSubTab(SubPreferenceSetting subPref) {
+        if (tabpane != null && subPref != null) {
+            Component tab = getSubTab(subPref);
+            if (tab != null) {
+                try {
+                    tabpane.setSelectedComponent(tab);
+                    return true;
+                } catch (IllegalArgumentException e) {
+                    // Ignore exception and return false below
+                    e.printStackTrace();
+                    System.out.println(tabpane.getTabCount());
+                    for (int i = 0; i < tabpane.getTabCount() ; i++) {
+                        System.out.println(tabpane.getComponentAt(i));
+                    }
+                }
+            }
+        }
+        return false;
+    }
+    
+    @Override
+    public final void addSubTab(SubPreferenceSetting sub, String title, Component component) {
+        addSubTab(sub, title, component, null);
+    }
+    
+    @Override
+    public final void addSubTab(SubPreferenceSetting sub, String title, Component component, String tip) {
+        if (tabpane != null && component != null) {
+            tabpane.addTab(title, null, component, tip);
+            registerSubTab(sub, component);
+        }
+    }
+    
+    @Override
+    public final void registerSubTab(SubPreferenceSetting sub, Component component) {
+        if (subSettingMap != null && sub != null && component != null) {
+            subSettingMap.put(sub, component);
+        }
+    }
+    
+    @Override
+    public final Component getSubTab(SubPreferenceSetting sub) {
+        return subSettingMap != null ? subSettingMap.get(sub) : null;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java	(revision 5631)
@@ -61,5 +61,5 @@
 
     private PluginPreference() {
-        super("plugin", tr("Plugins"), tr("Configure available plugins."));
+        super("plugin", tr("Plugins"), tr("Configure available plugins."), false, new JTabbedPane());
     }
 
@@ -163,14 +163,9 @@
     }
 
-    protected JPanel buildContentPanel() {
-        JPanel pnl = new JPanel(new BorderLayout());
-        JTabbedPane tpPluginPreferences = new JTabbedPane();
-        tpPluginPreferences.add(buildPluginListPanel());
-        tpPluginPreferences.add(pnlPluginUpdatePolicy  =new PluginUpdatePolicyPanel());
-        tpPluginPreferences.setTitleAt(0, tr("Plugins"));
-        tpPluginPreferences.setTitleAt(1, tr("Plugin update policy"));
-
-        pnl.add(tpPluginPreferences, BorderLayout.CENTER);
-        return pnl;
+    protected JTabbedPane buildContentPane() {
+        JTabbedPane pane = getTabPane();
+        pane.addTab(tr("Plugins"), buildPluginListPanel());
+        pane.addTab(tr("Plugin update policy"), pnlPluginUpdatePolicy = new PluginUpdatePolicyPanel());
+        return pane;
     }
 
@@ -182,5 +177,5 @@
         gc.fill = GridBagConstraints.BOTH;
         PreferencePanel plugins = gui.createPreferenceTab(this);
-        plugins.add(buildContentPanel(), gc);
+        plugins.add(buildContentPane(), gc);
         readLocalPluginInformation();
         pluginPreferencesActivated = true;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 5631)
@@ -32,5 +32,5 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener;
-import org.openstreetmap.josm.gui.preferences.map.MapPreference;
+import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -135,4 +135,8 @@
     }
 
+    public void selectSubPreferencesTabByClass(Class<? extends SubPreferenceSetting> clazz) {
+        tpPreferences.selectSubTabByPref(clazz);
+    }
+
     class CancelAction extends AbstractAction {
         public CancelAction() {
@@ -181,6 +185,5 @@
 
     public void selectMapPaintPreferenceTab() {
-        tpPreferences.selectTabByPref(MapPreference.class);
-        tpPreferences.getMapPreference().mapcontent.setSelectedIndex(1);
+        tpPreferences.selectSubTabByPref(MapPaintPreference.class);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 5631)
@@ -208,4 +208,20 @@
                 return tps.getClass().isAssignableFrom((Class<?>) clazz);
             }}, clazz);
+    }
+    
+    public boolean selectSubTabByPref(Class<? extends SubPreferenceSetting> clazz) {
+        for (PreferenceSetting setting : settings) {
+            if (clazz.isInstance(setting)) {
+                final SubPreferenceSetting sub = (SubPreferenceSetting) setting;
+                final TabPreferenceSetting tab = sub.getTabPreferenceSetting(PreferenceTabbedPane.this);
+                selectTabBy(new TabIdentifier(){
+                    @Override
+                    public boolean identify(TabPreferenceSetting tps, Object unused) {
+                        return tps.equals(tab);
+                    }}, null);
+                return tab.selectSubTab(sub);
+            }
+        }
+        return false;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java	(revision 5631)
@@ -27,10 +27,9 @@
     
     private ServerAccessPreference() {
-        super("connection", tr("Connection Settings"), tr("Connection Settings for the OSM server."));
+        super("connection", tr("Connection Settings"), tr("Connection Settings for the OSM server."), false, new JTabbedPane());
     }
 
     private OsmApiUrlInputPanel pnlApiUrlPreferences;
 
-    private JTabbedPane tpServerPreferences;
     /** indicates whether to use the default OSM URL or not */
     /** panel for configuring authentication preferences */
@@ -60,5 +59,5 @@
         JPanel pnl = new JPanel(new BorderLayout());
 
-        tpServerPreferences = new JTabbedPane();
+        JTabbedPane tpServerPreferences = getTabPane();
         pnlAuthPreferences = new AuthenticationPreferencesPanel();
         tpServerPreferences.add(wrapVerticallyScrollablePanel(pnlAuthPreferences));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/TabPreferenceSetting.java	(revision 5631)
@@ -1,4 +1,6 @@
 // License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.gui.preferences;
+
+import java.awt.Component;
 
 /**
@@ -29,7 +31,50 @@
     /**
      * Called during preferences tab initialization to display a description in one sentence for this tab. 
-     * Will be displayedin italic under the title.
+     * Will be displayed in italic under the title.
      * @return The description of this preferences tab.
      */
     public String getDescription();
+
+    /**
+     * Adds a new sub preference settings tab with the given title and component.
+     * @param sub The new sub preference settings.
+     * @param title The tab title.
+     * @param component The tab component.
+     * @since 5631
+     */
+    public void addSubTab(SubPreferenceSetting sub, String title, Component component);
+    
+    /**
+     * Adds a new sub preference settings tab with the given title, component and tooltip.
+     * @param sub The new sub preference settings.
+     * @param title The tab title.
+     * @param component The tab component.
+     * @param tip The tab tooltip.
+     * @since 5631
+     */
+    public void addSubTab(SubPreferenceSetting sub, String title, Component component, String tip);
+
+    /**
+     * Registers a sub preference settings to an existing tab component.
+     * @param sub The new sub preference settings.
+     * @param component The component for which a tab already exists.
+     * @since 5631
+     */
+    public void registerSubTab(SubPreferenceSetting sub, Component component);
+    
+    /**
+     * Returns the tab component related to the specified sub preference settings
+     * @param sub The requested sub preference settings.
+     * @return The component related to the specified sub preference settings, or null.
+     * @since 5631
+     */
+    public Component getSubTab(SubPreferenceSetting sub);
+
+    /**
+     * Selects the specified sub preference settings, if applicable. Not all Tab preference settings need to implement this.
+     * @param subPref The sub preference settings to be selected.
+     * @return true if the specified preference settings have been selected, false otherwise.
+     * @since 5631
+     */
+    public boolean selectSubTab(SubPreferenceSetting subPref);
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 5631)
@@ -239,5 +239,5 @@
         buttonPanel.add(defaultAll, GBC.std().insets(0,5,0,0));
         buttonPanel.add(remove, GBC.std().insets(0,5,0,0));
-        gui.getDisplayPreference().displaycontent.addTab(tr("Colors"), panel);
+        gui.getDisplayPreference().addSubTab(this, tr("Colors"), panel);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/DisplayPreference.java	(revision 5631)
@@ -20,8 +20,12 @@
     
     private DisplayPreference() {
-        super("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program."));
+        super("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program."), false, new JTabbedPane());
+        displaycontent = getTabPane();
     }
     
-    public final JTabbedPane displaycontent = new JTabbedPane();
+    /**
+     * @deprecated Use {@link #getTabPane()} instead. This field will be removed mid-2013.
+     */
+    public final JTabbedPane displaycontent;
     
     @Override
@@ -32,5 +36,5 @@
     @Override
     public void addGui(PreferenceTabbedPane gui) {
-        gui.createPreferenceTab(this).add(displaycontent, GBC.eol().fill(GBC.BOTH));
+        gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH));
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java	(revision 5631)
@@ -56,5 +56,5 @@
         JScrollPane scrollpane = new JScrollPane(panel);
         scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
-        gui.getDisplayPreference().displaycontent.addTab(tr("GPS Points"), scrollpane);
+        gui.getDisplayPreference().addSubTab(this, tr("GPS Points"), scrollpane);
         panel = new JPanel(new GridBagLayout());
         panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
@@ -142,5 +142,5 @@
         scrollpane = new JScrollPane(panel);
         scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
-        gui.getDisplayPreference().displaycontent.addTab(tr("OSM Data"), scrollpane);
+        gui.getDisplayPreference().addSubTab(this, tr("OSM Data"), scrollpane);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 5631)
@@ -116,5 +116,5 @@
         JScrollPane scrollpane = new JScrollPane(panel);
         scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
-        gui.getDisplayPreference().displaycontent.addTab(tr("Look and Feel"), scrollpane);
+        gui.getDisplayPreference().addSubTab(this, tr("Look and Feel"), scrollpane);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java	(revision 5631)
@@ -54,4 +54,7 @@
         panel.add(langCombo, GBC.eol().fill(GBC.HORIZONTAL));
         panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
+        
+        TabPreferenceSetting tabPref = lafPreference.getTabPreferenceSetting(gui);
+        tabPref.registerSubTab(this, tabPref.getSubTab(lafPreference));
     }
 
@@ -120,5 +123,5 @@
     @Override
     public TabPreferenceSetting getTabPreferenceSetting(final PreferenceTabbedPane gui) {
-        return gui.getDisplayPreference();
+        return gui.getSetting(LafPreference.class).getTabPreferenceSetting(gui);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java	(revision 5631)
@@ -76,5 +76,5 @@
 
     private ImageryPreference() {
-        super("imagery", tr("Imagery Preferences"), tr("Modify list of imagery layers displayed in the Imagery menu"));
+        super("imagery", tr("Imagery Preferences"), tr("Modify list of imagery layers displayed in the Imagery menu"), false, new JTabbedPane());
     }
 
@@ -115,14 +115,11 @@
     public void addGui(final PreferenceTabbedPane gui) {
         JPanel p = gui.createPreferenceTab(this);
-        JTabbedPane pane = new JTabbedPane();
+        JTabbedPane pane = getTabPane();
         layerInfo = new ImageryLayerInfo(ImageryLayerInfo.instance);
         imageryProviders = new ImageryProvidersPanel(gui, layerInfo);
-        pane.add(imageryProviders);
-        pane.add(buildSettingsPanel(gui));
-        pane.add(new OffsetBookmarksPanel(gui));
+        pane.addTab(tr("Imagery providers"), imageryProviders);
+        pane.addTab(tr("Settings"), buildSettingsPanel(gui));
+        pane.addTab(tr("Offset bookmarks"), new OffsetBookmarksPanel(gui));
         loadSettings();
-        pane.setTitleAt(0, tr("Imagery providers"));
-        pane.setTitleAt(1, tr("Settings"));
-        pane.setTitleAt(2, tr("Offset bookmarks"));
         p.add(pane,GBC.std().fill(GBC.BOTH));
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java	(revision 5631)
@@ -101,5 +101,5 @@
         sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
 
-        gui.getMapPreference().mapcontent.addTab(tr("File backup"), null, sp, tr("Configure whether to create backup files"));
+        gui.getMapPreference().addSubTab(this, tr("File backup"), sp, tr("Configure whether to create backup files"));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 5631)
@@ -65,13 +65,13 @@
         panel.add(enableIconDefault, GBC.eol().insets(11,2,5,0));
 
-        gui.getMapPreference().mapcontent.addTab(tr("Map Paint Styles"), panel);
+        gui.getMapPreference().addSubTab(this, tr("Map Paint Styles"), panel);
 
         // this defers loading of style sources to the first time the tab
         // with the map paint preferences is selected by the user
         //
-        gui.getMapPreference().mapcontent.addChangeListener(
+        gui.getMapPreference().getTabPane().addChangeListener(
                 new ChangeListener() {
                     public void stateChanged(ChangeEvent e) {
-                        if (gui.getMapPreference().mapcontent.getSelectedComponent() == panel) {
+                        if (gui.getMapPreference().getTabPane().getSelectedComponent() == panel) {
                             sources.initiallyLoadAvailableSources();
                         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPreference.java	(revision 5631)
@@ -20,8 +20,12 @@
     
     private MapPreference() {
-        super("map", tr("Map Settings"), tr("Settings for the map projection and data interpretation."));
+        super("map", tr("Map Settings"), tr("Settings for the map projection and data interpretation."), false, new JTabbedPane());
+        mapcontent = getTabPane();
     }
     
-    public final JTabbedPane mapcontent = new JTabbedPane();
+    /**
+     * @deprecated Use {@link #getTabPane()} instead. This field will be removed mid-2013.
+     */
+    public final JTabbedPane mapcontent; // FIXME remove it mid 2013
     
     @Override
@@ -32,5 +36,5 @@
     @Override
     public void addGui(PreferenceTabbedPane gui) {
-        gui.createPreferenceTab(this).add(mapcontent, GBC.eol().fill(GBC.BOTH));
+        gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH));
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java	(revision 5631)
@@ -163,13 +163,13 @@
         sources = new TaggingPresetSourceEditor();
         panel.add(sources, GBC.eol().fill(GBC.BOTH));
-        gui.getMapPreference().mapcontent.addTab(tr("Tagging Presets"), panel);
+        gui.getMapPreference().addSubTab(this, tr("Tagging Presets"), panel);
 
         // this defers loading of tagging preset sources to the first time the tab
         // with the tagging presets is selected by the user
         //
-        gui.getMapPreference().mapcontent.addChangeListener(
+        gui.getMapPreference().getTabPane().addChangeListener(
                 new ChangeListener() {
                     public void stateChanged(ChangeEvent e) {
-                        if (gui.getMapPreference().mapcontent.getSelectedComponent() == panel) {
+                        if (gui.getMapPreference().getTabPane().getSelectedComponent() == panel) {
                             sources.initiallyLoadAvailableSources();
                         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 5630)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 5631)
@@ -319,5 +319,5 @@
 
         JScrollPane scrollpane = new JScrollPane(projPanel);
-        gui.getMapPreference().mapcontent.addTab(tr("Map Projection"), scrollpane);
+        gui.getMapPreference().addSubTab(this, tr("Map Projection"), scrollpane);
 
         selectedProjectionChanged(pc);
