Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7628)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingComboBox.java	(revision 7631)
@@ -28,5 +28,7 @@
 
 /**
+ * Auto-completing ComboBox.
  * @author guilhem.bonnefille@gmail.com
+ * @since 272
  */
 public class AutoCompletingComboBox extends JosmComboBox<AutoCompletionListItem> {
@@ -39,6 +41,6 @@
     /**
      * Auto-complete a JosmComboBox.
-     *
-     * Inspired by http://www.orbital-computer.de/JComboBox/
+     * <br>
+     * Inspired by <a href="http://www.orbital-computer.de/JComboBox">Thomas Bierhance example</a>.
      */
     class AutoCompletingComboBoxDocument extends PlainDocument {
@@ -46,9 +48,14 @@
         private boolean selecting = false;
 
+        /**
+         * Constructs a new {@code AutoCompletingComboBoxDocument}.
+         * @param comboBox the combobox
+         */
         public AutoCompletingComboBoxDocument(final JosmComboBox<AutoCompletionListItem> comboBox) {
             this.comboBox = comboBox;
         }
 
-        @Override public void remove(int offs, int len) throws BadLocationException {
+        @Override
+        public void remove(int offs, int len) throws BadLocationException {
             if (selecting)
                 return;
@@ -56,10 +63,11 @@
         }
 
-        @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
+        @Override
+        public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
             if (selecting || (offs == 0 && str.equals(getText(0, getLength()))))
                 return;
             if (maxTextLength > -1 && str.length()+getLength() > maxTextLength)
                 return;
-            boolean initial = (offs == 0 && getLength() == 0 && str.length() > 1);
+            boolean initial = offs == 0 && getLength() == 0 && str.length() > 1;
             super.insertString(offs, str, a);
 
@@ -104,6 +112,5 @@
             if (item != null) {
                 String newText = ((AutoCompletionListItem) item).getValue();
-                if (!newText.equals(curText))
-                {
+                if (!newText.equals(curText)) {
                     selecting = true;
                     super.remove(0, size);
@@ -139,8 +146,7 @@
                 if (currentItem.getValue().equals(pattern))
                     return currentItem;
-                if (!match && currentItem.getValue().startsWith(pattern)) {
-                    if (bestItem == null || currentItem.getPriority().compareTo(bestItem.getPriority()) > 0) {
-                        bestItem = currentItem;
-                    }
+                if (!match && currentItem.getValue().startsWith(pattern)
+                && (bestItem == null || currentItem.getPriority().compareTo(bestItem.getPriority()) > 0)) {
+                    bestItem = currentItem;
                 }
             }
@@ -158,6 +164,6 @@
     /**
      * Creates a <code>AutoCompletingComboBox</code> with the specified prototype display value.
-     * @param prototype the <code>Object</code> used to compute the maximum number of elements to be displayed at once before displaying a scroll bar.
-     *                  It also affects the initial width of the combo box.
+     * @param prototype the <code>Object</code> used to compute the maximum number of elements to be displayed at once
+     *                  before displaying a scroll bar. It also affects the initial width of the combo box.
      * @since 5520
      */
@@ -171,7 +177,9 @@
                     @Override
                     public void focusLost(FocusEvent e) {
+                        Main.map.keyDetector.setEnabled(true);
                     }
                     @Override
                     public void focusGained(FocusEvent e) {
+                        Main.map.keyDetector.setEnabled(false);
                         // save unix system selection (middle mouse paste)
                         Clipboard sysSel = Toolkit.getDefaultToolkit().getSystemSelection();
@@ -188,4 +196,8 @@
     }
 
+    /**
+     * Sets the maximum text length.
+     * @param length the maximum text length in number of characters
+     */
     public void setMaxTextLength(int length) {
         this.maxTextLength = length;
@@ -236,5 +248,6 @@
 
     /**
-     * sets the items of the combobox to the given strings
+     * Sets the items of the combobox to the given {@code String}s.
+     * @param elems String items
      */
     public void setPossibleItems(Collection<String> elems) {
@@ -252,5 +265,6 @@
 
     /**
-     * sets the items of the combobox to the given AutoCompletionListItems
+     * Sets the items of the combobox to the given {@code AutoCompletionListItem}s.
+     * @param elems AutoCompletionListItem items
      */
     public void setPossibleACItems(Collection<AutoCompletionListItem> elems) {
@@ -266,5 +280,9 @@
     }
 
-    protected boolean isAutocompleteEnabled() {
+    /**
+     * Determines if autocompletion is enabled.
+     * @return {@code true} if autocompletion is enabled, {@code false} otherwise.
+     */
+    public final boolean isAutocompleteEnabled() {
         return autocompleteEnabled;
     }
@@ -277,4 +295,5 @@
      * If the locale is fixed, English keyboard layout will be used by default for this combobox
      * all other components can still have different keyboard layout selected
+     * @param f fixed locale
      */
     public void setFixedLocale(boolean f) {
@@ -314,6 +333,5 @@
                 int index,
                 boolean isSelected,
-                boolean cellHasFocus)
-        {
+                boolean cellHasFocus) {
             if (isSelected) {
                 setBackground(list.getSelectionBackground());
Index: trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 7628)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java	(revision 7631)
@@ -104,5 +104,4 @@
         disableMenuActions();
         unregisterActionShortcuts();
-        Main.map.keyDetector.setEnabled(false);
     }
 
@@ -110,5 +109,4 @@
     public void focusLost(FocusEvent e) {
         super.focusLost(e);
-        Main.map.keyDetector.setEnabled(true);
         restoreActionShortcuts();
         restoreMenuActions();
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java	(revision 7628)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmPasswordField.java	(revision 7631)
@@ -3,4 +3,6 @@
 
 import java.awt.event.ActionEvent;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.beans.PropertyChangeListener;
 
@@ -16,5 +18,4 @@
  * A subclass of {@link JPasswordField} to implement a workaround to
  * <a href="https://bugs.openjdk.java.net/browse/JDK-6322854">JDK bug 6322854</a>.
- * This class can be deleted after Oracle decides to fix this bug...
  *
  * @since 5752
@@ -22,5 +23,5 @@
  * @see <a href="https://hg.netbeans.org/main/rev/33cb2e81b640">https://hg.netbeans.org/main/rev/33cb2e81b640</a>
  */
-public class JosmPasswordField extends JPasswordField {
+public class JosmPasswordField extends JPasswordField implements FocusListener {
 
     /**
@@ -31,4 +32,5 @@
     public JosmPasswordField() {
         workaroundJdkBug6322854(this);
+        addFocusListener(this);
     }
 
@@ -51,4 +53,5 @@
         super(doc, txt, columns);
         workaroundJdkBug6322854(this);
+        addFocusListener(this);
     }
 
@@ -63,4 +66,5 @@
         super(columns);
         workaroundJdkBug6322854(this);
+        addFocusListener(this);
     }
 
@@ -76,4 +80,5 @@
         super(text, columns);
         workaroundJdkBug6322854(this);
+        addFocusListener(this);
     }
 
@@ -88,8 +93,20 @@
         super(text);
         workaroundJdkBug6322854(this);
+        addFocusListener(this);
+    }
+
+    @Override
+    public void focusGained(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(false);
+    }
+
+    @Override
+    public void focusLost(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(true);
     }
 
     /**
      * Implements a workaround to <a href="https://bugs.openjdk.java.net/browse/JDK-6322854">JDK bug 6322854</a>.
+     * This method can be deleted after Oracle decides to fix this bug...
      * @param text The {@link JTextComponent} to protect.
      */
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(revision 7628)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextArea.java	(revision 7631)
@@ -2,6 +2,11 @@
 package org.openstreetmap.josm.gui.widgets;
 
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
 import javax.swing.JTextArea;
 import javax.swing.text.Document;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -9,5 +14,5 @@
  * @since 5886
  */
-public class JosmTextArea extends JTextArea {
+public class JosmTextArea extends JTextArea implements FocusListener {
 
     /**
@@ -82,4 +87,15 @@
         super(doc, text, rows, columns);
         TextContextualPopupMenu.enableMenuFor(this);
+        addFocusListener(this);
+    }
+
+    @Override
+    public void focusGained(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(false);
+    }
+
+    @Override
+    public void focusLost(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(true);
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 7628)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 7631)
@@ -14,7 +14,12 @@
 import javax.swing.text.Document;
 
+import org.openstreetmap.josm.Main;
+
 /**
- * Subclass of {@link JTextField} that adds a "native" context menu (cut/copy/paste/select all)
- * and an optional "hint" displayed when no text has been entered.
+ * Subclass of {@link JTextField} that:<ul>
+ * <li>adds a "native" context menu (cut/copy/paste/select all)</li>
+ * <li>adds an optional "hint" displayed when no text has been entered</li>
+ * <li>disables the global advanced key press detector when focused</li>
+ * <br>This class must be used everywhere in core and plugins instead of {@code JTextField}.
  * @since 5886
  */
@@ -136,4 +141,5 @@
     @Override
     public void focusGained(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(false);
         repaint();
     }
@@ -141,4 +147,5 @@
     @Override
     public void focusLost(FocusEvent e) {
+        Main.map.keyDetector.setEnabled(true);
         repaint();
     }
