- Timestamp:
- 2014-10-14T00:25:24+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
r7539 r7618 3 3 4 4 import java.awt.event.FocusEvent; 5 import java.awt.event.FocusListener;6 5 import java.awt.event.KeyEvent; 7 6 import java.util.ArrayList; … … 27 26 * @since 5696 28 27 */ 29 public class DisableShortcutsOnFocusGainedTextField extends JosmTextField implements FocusListener{28 public class DisableShortcutsOnFocusGainedTextField extends JosmTextField { 30 29 31 30 /** … … 35 34 */ 36 35 public DisableShortcutsOnFocusGainedTextField() { 37 init();38 36 } 39 37 … … 47 45 public DisableShortcutsOnFocusGainedTextField(String text) { 48 46 super(text); 49 init();50 47 } 51 48 … … 63 60 public DisableShortcutsOnFocusGainedTextField(int columns) { 64 61 super(columns); 65 init();66 62 } 67 63 … … 78 74 public DisableShortcutsOnFocusGainedTextField(String text, int columns) { 79 75 super(text, columns); 80 init();81 76 } 82 77 … … 99 94 public DisableShortcutsOnFocusGainedTextField(Document doc, String text, int columns) { 100 95 super(doc, text, columns); 101 init();102 96 } 103 97 … … 105 99 private final Set<JosmAction> disabledMenuActions = new HashSet<>(); 106 100 107 protected final void init() {108 addFocusListener(this);109 }110 111 101 @Override 112 102 public void focusGained(FocusEvent e) { 103 super.focusGained(e); 113 104 disableMenuActions(); 114 105 unregisterActionShortcuts(); … … 118 109 @Override 119 110 public void focusLost(FocusEvent e) { 111 super.focusLost(e); 120 112 Main.map.keyDetector.setEnabled(true); 121 113 restoreActionShortcuts();
Note:
See TracChangeset
for help on using the changeset viewer.