Changeset 6830 in josm for trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
- Timestamp:
- 2014-02-10T00:51:53+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/DisableShortcutsOnFocusGainedTextField.java
r5927 r6830 56 56 * <code>null</code>. 57 57 * 58 * @param columns the number of columns to use to calculate 58 * @param columns the number of columns to use to calculate 59 59 * the preferred width; if columns is set to zero, the 60 60 * preferred width will be whatever naturally results from 61 61 * the component implementation 62 */ 62 */ 63 63 public DisableShortcutsOnFocusGainedTextField(int columns) { 64 64 super(columns); … … 71 71 * 72 72 * @param text the text to be displayed, or <code>null</code> 73 * @param columns the number of columns to use to calculate 73 * @param columns the number of columns to use to calculate 74 74 * the preferred width; if columns is set to zero, the 75 75 * preferred width will be whatever naturally results from … … 91 91 * <code>createDefaultModel</code> method 92 92 * @param text the initial string to display, or <code>null</code> 93 * @param columns the number of columns to use to calculate 94 * the preferred width >= 0; if <code>columns</code>93 * @param columns the number of columns to use to calculate 94 * the preferred width >= 0; if <code>columns</code> 95 95 * is set to zero, the preferred width will be whatever 96 96 * naturally results from the component implementation 97 * @exception IllegalArgumentException if <code>columns</code> <097 * @exception IllegalArgumentException if <code>columns</code> < 0 98 98 */ 99 99 public DisableShortcutsOnFocusGainedTextField(Document doc, String text, int columns) { … … 108 108 addFocusListener(this); 109 109 } 110 110 111 111 @Override 112 112 public void focusGained(FocusEvent e) { … … 120 120 restoreMenuActions(); 121 121 } 122 122 123 123 /** 124 124 * Disables all relevant menu actions. … … 149 149 } 150 150 } 151 151 152 152 /** 153 153 * Unregisters all relevant action shortcuts. … … 156 156 protected void unregisterActionShortcuts() { 157 157 unregisteredActionShortcuts.clear(); 158 // Unregister all actions without modifiers to avoid them to be triggered by typing in this text field 158 // Unregister all actions without modifiers to avoid them to be triggered by typing in this text field 159 159 for (Shortcut shortcut : Shortcut.listAll()) { 160 160 KeyStroke ks = shortcut.getKeyStroke(); … … 168 168 } 169 169 } 170 170 171 171 /** 172 172 * Returns true if the given shortcut has no modifier and is not an actions key.
Note:
See TracChangeset
for help on using the changeset viewer.