Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 3501)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 3502)
@@ -24,7 +24,5 @@
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
-import javax.swing.ComponentInputMap;
 import javax.swing.ImageIcon;
-import javax.swing.InputMap;
 import javax.swing.JButton;
 import javax.swing.JComponent;
@@ -33,5 +31,4 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.Main;
@@ -40,4 +37,5 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.help.Helpful;
+import org.openstreetmap.josm.gui.util.RedirectInputMap;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -49,55 +47,4 @@
  */
 public class ToggleDialog extends JPanel implements Helpful {
-
-    // It's not possible to simply set component input map parent to be Main.contentPane.getInputMap because
-    // there is check in setParent that InputMap is for the same component
-    // Yes, this is a hack
-    // Another possibility would be simply copy InputMap, but that would require to keep copies synchronized when some shortcut is
-    // later
-    private static class RedirectInputMap extends ComponentInputMap {
-
-        private final InputMap target;
-
-        public RedirectInputMap(JComponent component, InputMap target) {
-            super(component);
-            this.target = target;
-        }
-
-        @Override
-        public Object get(KeyStroke keyStroke) {
-            return target.get(keyStroke);
-        }
-
-        @Override
-        public KeyStroke[] keys() {
-            return target.keys();
-        }
-
-        @Override
-        public int size() {
-            return target.size();
-        }
-
-        @Override
-        public KeyStroke[] allKeys() {
-            return target.allKeys();
-        }
-
-        @Override
-        public void put(KeyStroke keyStroke, Object actionMapKey) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void remove(KeyStroke key) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void clear() {
-            throw new UnsupportedOperationException();
-        }
-
-    }
 
     /** The action to toggle this dialog */
@@ -152,5 +99,4 @@
      * @param defShow if the dialog should be shown by default, if there is no preference
      */
-    @SuppressWarnings("deprecation")
     public ToggleDialog(String name, String iconName, String tooltip, Shortcut shortcut, int preferredHeight, boolean defShow) {
         super(new BorderLayout());
@@ -180,10 +126,5 @@
         isCollapsed = Main.pref.getBoolean(preferencePrefix+".minimized", false);
 
-        InputMap lastParent = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
-        while (lastParent.getParent() != null) {
-            lastParent = lastParent.getParent();
-        }
-        lastParent.setParent(new RedirectInputMap(this, Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)));
-        getActionMap().setParent(Main.contentPane.getActionMap());
+        RedirectInputMap.redirectToMainContentPane(this);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 3501)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 3502)
@@ -72,4 +72,5 @@
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
+import org.openstreetmap.josm.gui.util.RedirectInputMap;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -185,4 +186,5 @@
         memberTableModel.setSelectedMembers(selectedMembers);
         HelpUtil.setHelpContext(getRootPane(),ht("/Dialog/RelationEditor"));
+        RedirectInputMap.redirectToMainContentPane(getRootPane());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/util/RedirectInputMap.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/RedirectInputMap.java	(revision 3502)
+++ trunk/src/org/openstreetmap/josm/gui/util/RedirectInputMap.java	(revision 3502)
@@ -0,0 +1,77 @@
+// License: GPL. See LICENSE file for details.
+package org.openstreetmap.josm.gui.util;
+
+import javax.swing.ComponentInputMap;
+import javax.swing.InputMap;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+
+import org.openstreetmap.josm.Main;
+
+/**
+ * Make shortcuts from main window work in dialog windows.
+ *
+ * It's not possible to simply set component input map parent to be Main.contentPane.getInputMap
+ * because there is check in setParent that InputMap is for the same component.
+ * Yes, this is a hack.
+ * Another possibility would be simply copy InputMap, but that would require to
+ * keep copies synchronized when some shortcuts are changed later.
+ */
+public class RedirectInputMap extends ComponentInputMap {
+
+    private final InputMap target;
+
+    public RedirectInputMap(JComponent component, InputMap target) {
+        super(component);
+        this.target = target;
+    }
+
+    @Override
+    public Object get(KeyStroke keyStroke) {
+        return target.get(keyStroke);
+    }
+
+    @Override
+    public KeyStroke[] keys() {
+        return target.keys();
+    }
+
+    @Override
+    public int size() {
+        return target.size();
+    }
+
+    @Override
+    public KeyStroke[] allKeys() {
+        return target.allKeys();
+    }
+
+    @Override
+    public void put(KeyStroke keyStroke, Object actionMapKey) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void remove(KeyStroke key) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void clear() {
+        throw new UnsupportedOperationException();
+    }
+
+    public static void redirectToMainContentPane(JComponent source) {
+        @SuppressWarnings("deprecation") JComponent target = Main.contentPane;
+        redirect(source, target);
+    }
+    
+    public static void redirect(JComponent source, JComponent target) {
+        InputMap lastParent = source.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+        while (lastParent.getParent() != null) {
+            lastParent = lastParent.getParent();
+        }
+        lastParent.setParent(new RedirectInputMap(source, target.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)));
+        source.getActionMap().setParent(target.getActionMap());
+    }
+}
