Ignore:
Timestamp:
2014-10-18T20:50:35+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #10647 - Shortcuts are activated while in dialogs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java

    r7505 r7631  
    1414import javax.swing.text.Document;
    1515
     16import org.openstreetmap.josm.Main;
     17
    1618/**
    17  * Subclass of {@link JTextField} that adds a "native" context menu (cut/copy/paste/select all)
    18  * and an optional "hint" displayed when no text has been entered.
     19 * Subclass of {@link JTextField} that:<ul>
     20 * <li>adds a "native" context menu (cut/copy/paste/select all)</li>
     21 * <li>adds an optional "hint" displayed when no text has been entered</li>
     22 * <li>disables the global advanced key press detector when focused</li>
     23 * <br>This class must be used everywhere in core and plugins instead of {@code JTextField}.
    1924 * @since 5886
    2025 */
     
    136141    @Override
    137142    public void focusGained(FocusEvent e) {
     143        Main.map.keyDetector.setEnabled(false);
    138144        repaint();
    139145    }
     
    141147    @Override
    142148    public void focusLost(FocusEvent e) {
     149        Main.map.keyDetector.setEnabled(true);
    143150        repaint();
    144151    }
Note: See TracChangeset for help on using the changeset viewer.