Changeset 8720 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-09-02T23:11:47+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8689 r8720 849 849 } 850 850 }; 851 Shortcut searchFieldShortcut = Shortcut.registerShortcut("menu:search-field", tr("Search menu items"), KeyEvent.VK_R, Shortcut.MNEMONIC); 852 searchFieldShortcut.setFocusAccelerator(searchField); 851 853 searchField.setEditable(true); 852 854 searchField.setMaximumSize(new Dimension(200, helpMenu.getPreferredSize().height)); 853 855 searchField.setHint(tr("Search menu items")); 854 searchField.setToolTipText( tr("Search menu items"));856 searchField.setToolTipText(Main.platform.makeTooltip(tr("Search menu items"), searchFieldShortcut)); 855 857 searchField.addKeyListener(new SearchFieldKeyListener()); 856 858 searchField.getDocument().addDocumentListener(new SearchFieldTextListener(this, searchField)); -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r8510 r8720 17 17 import javax.swing.JMenu; 18 18 import javax.swing.KeyStroke; 19 import javax.swing.text.JTextComponent; 19 20 20 21 import org.openstreetmap.josm.Main; … … 215 216 } 216 217 /** 218 * Sets the mnemonic key on a text component. 219 */ 220 public void setFocusAccelerator(JTextComponent component) { 221 if (assignedModifier == getGroupModifier(MNEMONIC) && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) { 222 component.setFocusAccelerator(KeyEvent.getKeyText(assignedKey).charAt(0)); 223 } 224 } 225 /** 217 226 * use this to set a actions's accelerator 218 227 */
Note:
See TracChangeset
for help on using the changeset viewer.