Changeset 5659 in josm
- Timestamp:
- 2013-01-03T20:19:57+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r5658 r5659 549 549 // Create action for reusing the tag, with keyboard shortcut Ctrl+(1-5) 550 550 String actionShortcutKey = "properties:recent:"+count; 551 String actionShortcutShiftKey = "properties:recent:shift:"+count; 551 552 Shortcut sc = Shortcut.registerShortcut(actionShortcutKey, null, KeyEvent.VK_0+count, Shortcut.CTRL); 552 553 final JosmAction action = new JosmAction(actionShortcutKey, null, tr("Use this tag again"), sc, false) { … … 561 562 } 562 563 }; 564 Shortcut scShift = Shortcut.registerShortcut(actionShortcutShiftKey, null, KeyEvent.VK_0+count, Shortcut.CTRL_SHIFT); 565 final JosmAction actionShift = new JosmAction(actionShortcutShiftKey, null, tr("Use this tag again"), scShift, false) { 566 @Override 567 public void actionPerformed(ActionEvent e) { 568 action.actionPerformed(null); 569 performTagAdding(); 570 selectKeysComboBox(); 571 } 572 }; 563 573 recentTagsActions.add(action); 574 recentTagsActions.add(actionShift); 564 575 disableTagIfNeeded(t, action); 565 576 // Find and display icon … … 580 591 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(sc.getKeyStroke(), actionShortcutKey); 581 592 mainPanel.getActionMap().put(actionShortcutKey, action); 593 mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(scShift.getKeyStroke(), actionShortcutShiftKey); 594 mainPanel.getActionMap().put(actionShortcutShiftKey, actionShift); 582 595 // Make the tag label clickable and set tooltip to the action description (this displays also the keyboard shortcut) 583 596 tagLabel.setToolTipText((String) action.getValue(Action.SHORT_DESCRIPTION));
Note:
See TracChangeset
for help on using the changeset viewer.