Changeset 5449 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2012-08-17T07:45:35+02:00 (12 years ago)
Author:
jttt
Message:

Show multikey shortcut hint in menu

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r5200 r5449  
    2121import javax.swing.JCheckBox;
    2222import javax.swing.JTable;
    23 import javax.swing.KeyStroke;
    2423import javax.swing.ListSelectionModel;
    2524import javax.swing.SwingUtilities;
     
    7372        super(tr("Filter"), "filter", tr("Filter objects and hide/disable them."),
    7473                Shortcut.registerShortcut("subwindow:filter", tr("Toggle: {0}", tr("Filter")),
    75                 KeyEvent.VK_F, Shortcut.ALT_SHIFT), 162);
     74                        KeyEvent.VK_F, Shortcut.ALT_SHIFT), 162);
    7675        build();
    7776        enableFilterAction = new EnableFilterAction();
     
    9695    private static final Shortcut ENABLE_FILTER_SHORTCUT
    9796    = Shortcut.registerShortcut("core_multikey:enableFilter", tr("Multikey: {0}", tr("Enable filter")),
    98     KeyEvent.VK_E, Shortcut.ALT_CTRL);
     97            KeyEvent.VK_E, Shortcut.ALT_CTRL);
    9998
    10099    private static final Shortcut HIDING_FILTER_SHORTCUT
    101100    = Shortcut.registerShortcut("core_multikey:hidingFilter", tr("Multikey: {0}", tr("Hide filter")),
    102     KeyEvent.VK_H, Shortcut.ALT_CTRL);
     101            KeyEvent.VK_H, Shortcut.ALT_CTRL);
    103102
    104103
     
    214213            }
    215214        });
    216        
     215
    217216        // Toggle filter "enabled" on Enter
    218217        InputMapUtils.addEnterAction(userTable, new AbstractAction() {
     
    246245        super.destroy();
    247246    }
    248    
     247
    249248    static class StringRenderer extends DefaultTableCellRenderer {
    250249        @Override
     
    389388        EnableFilterAction() {
    390389            putValue(SHORT_DESCRIPTION, tr("Enable filter"));
     390            ENABLE_FILTER_SHORTCUT.setAccelerator(this);
    391391        }
    392392
     
    412412        public HidingFilterAction() {
    413413            putValue(SHORT_DESCRIPTION, tr("Hiding filter"));
     414            HIDING_FILTER_SHORTCUT.setAccelerator(this);
    414415        }
    415416
  • trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java

    r5314 r5449  
    274274                );
    275275        getActionMap().put("delete", deleteLayerAction);
    276        
     276
    277277        // Activate layer on Enter key press
    278278        InputMapUtils.addEnterAction(layerList, new AbstractAction() {
     
    282282            }
    283283        });
    284        
     284
    285285        // Show/Activate layer on Enter key press
    286286        InputMapUtils.addSpacebarAction(layerList, showHideLayerAction);
    287        
     287
    288288        createLayout(layerList, true, Arrays.asList(new SideButton[] {
    289289                new SideButton(moveUpAction, false),
     
    469469            multikeyShortcut = Shortcut.registerShortcut("core_multikey:showHideLayer", tr("Multikey: {0}",
    470470                    tr("Show/hide layer")), KeyEvent.VK_S, Shortcut.SHIFT);
     471            multikeyShortcut.setAccelerator(this);
    471472            if (init) {
    472473                updateEnabledState();
     
    671672            multikeyShortcut = Shortcut.registerShortcut("core_multikey:activateLayer", tr("Multikey: {0}",
    672673                    tr("Activate layer")), KeyEvent.VK_A, Shortcut.SHIFT);
     674            multikeyShortcut.setAccelerator(this);
    673675            putValue("help", HelpUtil.ht("/Dialog/LayerList#ActivateLayer"));
    674676        }
  • trunk/src/org/openstreetmap/josm/gui/layer/JumpToMarkerActions.java

    r5018 r5449  
    2525    private static JumpToNextMarker jumpToNextMarkerAction;
    2626    private static JumpToPreviousMarker jumpToPreviousMarkerAction;
    27            
     27
    2828    public static void initialize() {
    2929        jumpToNextMarkerAction = new JumpToNextMarker(null);
     
    3232        MultikeyActionsHandler.getInstance().addAction(jumpToPreviousMarkerAction);
    3333    }
    34    
     34
    3535    public static void unregisterActions() {
    3636        MultikeyActionsHandler.getInstance().removeAction(jumpToNextMarkerAction);
     
    4646        public JumpToNextMarker(JumpToMarkerLayer layer) {
    4747            multikeyShortcut = Shortcut.registerShortcut("core_multikey:nextMarker", tr("Multikey: {0}", tr("Next marker")),
    48                 KeyEvent.VK_J, Shortcut.ALT_CTRL);
     48                    KeyEvent.VK_J, Shortcut.ALT_CTRL);
     49            multikeyShortcut.setAccelerator(this);
    4950            putValue(SHORT_DESCRIPTION, tr("Jump to next marker"));
    5051            putValue(NAME, tr("Jump to next marker"));
     
    107108            this.layer = (Layer)layer;
    108109
    109             Shortcut.registerShortcut("core_multikey:previousMarker", tr("Multikey: {0}", tr("Previos marker")),
    110                 KeyEvent.VK_P, Shortcut.ALT_CTRL).setAccelerator(this);
     110            multikeyShortcut = Shortcut.registerShortcut("core_multikey:previousMarker", tr("Multikey: {0}", tr("Previos marker")),
     111                    KeyEvent.VK_P, Shortcut.ALT_CTRL);
     112            multikeyShortcut.setAccelerator(this);
    111113            putValue(SHORT_DESCRIPTION, tr("Jump to previous marker"));
    112114            putValue(NAME, tr("Jump to previous marker"));
Note: See TracChangeset for help on using the changeset viewer.