Changeset 9263 in josm for trunk/src/org
- Timestamp:
- 2016-01-02T17:26:58+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r9262 r9263 706 706 final Tag t = tags.get(i); 707 707 // Create action for reusing the tag, with keyboard shortcut 708 final String actionShortcutKey = "properties:recent:" + count;709 final String actionShortcutShiftKey = "properties:recent:shift:" + count;710 708 /* POSSIBLE SHORTCUTS: 1,2,3,4,5,6,7,8,9,0=10 */ 711 709 final Shortcut sc = count > 10 ? null : Shortcut.registerShortcut( 712 actionShortcutKey, tr("Choose recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL);713 final JosmAction action = new JosmAction( actionShortcutKey, null, tr("Use this tag again"), sc, false) {710 "properties:recent:" + count, tr("Choose recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL); 711 final JosmAction action = new JosmAction(tr("Choose recent tag {0}", count), null, tr("Use this tag again"), sc, false) { 714 712 @Override 715 713 public void actionPerformed(ActionEvent e) { … … 723 721 /* POSSIBLE SHORTCUTS: 1,2,3,4,5,6,7,8,9,0=10 */ 724 722 final Shortcut scShift = count > 10 ? null : Shortcut.registerShortcut( 725 actionShortcutShiftKey, tr("Apply recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL_SHIFT);726 final JosmAction actionShift = new JosmAction( actionShortcutShiftKey, null, tr("Use this tag again"), scShift, false) {723 "properties:recent:apply:" + count, tr("Apply recent tag {0}", count), KeyEvent.VK_0 + (count % 10), Shortcut.CTRL_SHIFT); 724 final JosmAction actionShift = new JosmAction(tr("Apply recent tag {0}", count), null, tr("Use this tag again"), scShift, false) { 727 725 @Override 728 726 public void actionPerformed(ActionEvent e) { … … 766 764 if (action.isEnabled() && sc != null && scShift != null) { 767 765 // Register action 768 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), actionShortcutKey);769 mainPanel.getActionMap().put( actionShortcutKey, action);770 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scShift.getKeyStroke(), actionShortcutShiftKey);771 mainPanel.getActionMap().put( actionShortcutShiftKey, actionShift);766 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), "choose"+count); 767 mainPanel.getActionMap().put("choose"+count, action); 768 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scShift.getKeyStroke(), "apply"+count); 769 mainPanel.getActionMap().put("apply"+count, actionShift); 772 770 } 773 771 if (action.isEnabled()) {
Note:
See TracChangeset
for help on using the changeset viewer.