This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 46811
Collapse All | Expand All

(-)core/execution/src/org/netbeans/core/execution/resources/layer.xml (-2 / +2 lines)
Lines 39-48 Link Here
39
    </folder>  
39
    </folder>  
40
    
40
    
41
    <folder name="Shortcuts">
41
    <folder name="Shortcuts">
42
        <file name="CS-6.instance">
42
        <file name="DS-6.instance">
43
            <attr name="instanceClass" stringvalue="org.netbeans.core.execution.ExecutionViewAction"/>
43
            <attr name="instanceClass" stringvalue="org.netbeans.core.execution.ExecutionViewAction"/>
44
	</file>
44
	</file>
45
        <file name="C-5.shadow">
45
        <file name="D-5.shadow">
46
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-actions-ViewRuntimeTabAction.instance"/>
46
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-actions-ViewRuntimeTabAction.instance"/>
47
        </file>
47
        </file>
48
    </folder>
48
    </folder>
(-)core/favorites/src/org/netbeans/modules/favorites/resources/layer.xml (-2 / +2 lines)
Lines 49-58 Link Here
49
    </folder>
49
    </folder>
50
    
50
    
51
    <folder name="Shortcuts">
51
    <folder name="Shortcuts">
52
        <file name="C-3.shadow">
52
        <file name="D-3.shadow">
53
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-favorites-View.instance"/>
53
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-favorites-View.instance"/>
54
	</file>
54
	</file>
55
        <file name="CS-3.shadow">
55
        <file name="DS-3.shadow">
56
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-favorites-Select.instance"/>
56
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-favorites-Select.instance"/>
57
	</file>
57
	</file>
58
    </folder>
58
    </folder>
(-)core/output/src/org/netbeans/core/output/resources/layer.xml (-1 / +1 lines)
Lines 36-42 Link Here
36
        <file name="S-F12.instance">
36
        <file name="S-F12.instance">
37
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output.PreviousOutJumpAction"/>
37
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output.PreviousOutJumpAction"/>
38
	</file>
38
	</file>
39
        <file name="C-4.instance">
39
        <file name="D-4.instance">
40
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output.OutputWindowAction"/>
40
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output.OutputWindowAction"/>
41
	</file>
41
	</file>
42
    </folder>
42
    </folder>
(-)core/output2/src/org/netbeans/core/output2/layer.xml (-1 / +1 lines)
Lines 43-49 Link Here
43
        <file name="S-F12.instance">
43
        <file name="S-F12.instance">
44
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output2.PreviousOutJumpAction"/>
44
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output2.PreviousOutJumpAction"/>
45
	</file>
45
	</file>
46
        <file name="C-4.instance">
46
        <file name="D-4.instance">
47
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output2.OutputWindowAction"/>
47
	    <attr name="instanceClass" stringvalue="org.netbeans.core.output2.OutputWindowAction"/>
48
	</file>
48
	</file>
49
    </folder>
49
    </folder>
(-)core/src/org/netbeans/core/ShortcutsFolder.java (-1 / +119 lines)
Lines 17-22 Link Here
17
import java.awt.*;
17
import java.awt.*;
18
import java.awt.event.*;
18
import java.awt.event.*;
19
import java.util.*;
19
import java.util.*;
20
import java.util.Collection;
21
import java.util.List;
20
import javax.swing.text.Keymap;
22
import javax.swing.text.Keymap;
21
import javax.swing.*;
23
import javax.swing.*;
22
24
Lines 444-450 Link Here
444
                            }
446
                            }
445
                        }
447
                        }
446
                    } else {
448
                    } else {
447
                        InstanceDataObject.remove(f, r.instanceName(), r.instanceClass());
449
                        String instanceName = r.instanceName();
450
                        if (!InstanceDataObject.remove(f, instanceName, r.instanceClass())) {
451
                            //We may be deleting a wildcard keystroke, and/or the
452
                            //order defined in the layer may not be the same as
453
                            //what we were fed by the shortcuts editor, so search
454
                            //all the possible variants
455
                            String[] permutations = getPermutations(instanceName);
456
                            for (int i=0; i < permutations.length; i++) {
457
                                if (InstanceDataObject.remove(f, permutations[i], r.instanceClass())) {
458
                                    break;
459
                                }
460
                            }
461
                        } 
448
                    }
462
                    }
449
                } else { // It is '.shadow' file
463
                } else { // It is '.shadow' file
450
                    FileObject root = f.getPrimaryFile();
464
                    FileObject root = f.getPrimaryFile();
Lines 459-464 Link Here
459
                        if(foRemove != null) {
473
                        if(foRemove != null) {
460
                            foRemove.delete();
474
                            foRemove.delete();
461
                        }
475
                        }
476
                        String[] permutations = getPermutations(r.instanceName());
477
                        //We may be deleting a wildcard keystroke, and/or the
478
                        //order defined in the layer may not be the same as
479
                        //what we were fed by the shortcuts editor, so search
480
                        //all the possible variants
481
                        for (int i=0; i < permutations.length; i++) {
482
                            foRemove = root.getFileObject(permutations[i], "shadow");
483
                            if (foRemove != null) {
484
                                foRemove.delete();
485
                                break;
486
                            }
487
                        }
462
                    }
488
                    }
463
                }
489
                }
464
            } catch (ClassNotFoundException ex) {
490
            } catch (ClassNotFoundException ex) {
Lines 468-473 Link Here
468
            }
494
            }
469
        }
495
        }
470
    }
496
    }
497
    
498
    /**
499
     * There is no required ordering of key modifiers (C, M, S, A), and the
500
     * D (default) wildcard character can map to either C or M depending on 
501
     * the platform.  So when we need to delete a keybinding, the editor has
502
     * given us one possible ordering, but not necessarily the correct one; it
503
     * has also given us a hard keybinding, but the key may really be bound to
504
     * D.  So, for "MAS-F5" (meta-alt-shift F5) on the pc, we need to check
505
     * MSA-F5, SMA-F5, SAM-F5, AMS-F5, ASM-F5; on the mac, we also need to check
506
     * the same permutations of DAS-F5, since it may be registered with the 
507
     * wildcard character.
508
     * <p>
509
     * Finally, for each permutation, it is legal to separate characters with
510
     * dashes - so for each permutation, we must also check for a hyphenated
511
     * variant - i.e. for MAS-F5, we must check M-A-S-F5.  Note that mixed
512
     * hyphenation (M-AS-F5) is not supported.  It either is or it isn't.
513
     *
514
     */
515
    private static String[] getPermutations (String name) {
516
        String key = KeyEvent.META_MASK == Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() ?
517
            "M" : "C"; //NOI18N
518
            
519
        int pos = name.lastIndexOf ("-"); //NOI18N
520
        String keyPart = name.substring (pos);
521
        String modsPart = Utilities.replaceString (name.substring (0, pos), "-", "");
522
        if (modsPart.length() > 1) {
523
            Collection perms = new HashSet(modsPart.length() * modsPart.length());
524
            int idx = name.indexOf(key);
525
            if (idx != -1) {
526
                //First, try with the wildcard key.  Remove all hyphens - we'll
527
                //put them back later
528
                StringBuffer sb = new StringBuffer(modsPart);
529
                sb.replace(idx, idx+1, "D");
530
                perms.add (sb.toString() + keyPart);
531
                getAllPossibleOrderings (sb.toString(), keyPart, perms);
532
                createHyphenatedPermutation(sb.toString().toCharArray(), perms, keyPart);
533
            }
534
            getAllPossibleOrderings (modsPart, keyPart, perms);
535
            createHyphenatedPermutation(modsPart.toCharArray(), perms, keyPart);
536
            return (String[]) perms.toArray(new String[perms.size()]);
537
        } else {
538
            return "C".equals (modsPart) ?
539
                new String[] {"D" + keyPart} : new String[0];
540
        }
541
    }
542
    
543
    /**
544
     * Retrieves all the possible orders for the passed in string, and puts them
545
     * in the passed collection, appending <code>toAppend</code> to each.
546
     */
547
    private static void getAllPossibleOrderings (String s, String toAppend, final Collection store) {
548
        char[] c = s.toCharArray();
549
        mutate (c, store, 0, toAppend);
550
        String[] result = (String[]) store.toArray(new String[store.size()]);
551
    }   
552
    
553
    /**
554
     * Recursively generates all possible orderings of the passed char array
555
     */
556
    private static void mutate(char[] c, Collection l, int n, String toAppend) {
557
        if (n == c.length) {
558
            l.add (new String(c) + toAppend);
559
            createHyphenatedPermutation(c, l, toAppend);
560
            return;
561
        }
562
        //XXX could be optimized to eliminate duplicates
563
        for (int i=0; i < c.length; i++) {
564
            char x = c[i];
565
            c[i] = c[n];
566
            c[n] = x;
567
            if (n < c.length) { 
568
                mutate (c, l, n+1, toAppend);
569
            } 
570
        }
571
    }
572
    
573
    /**
574
     * Inserts "-" characters between each character in the char array and
575
     * adds the result + toAppend to the collection.
576
     */
577
    private static void createHyphenatedPermutation (char[] c, Collection l, String toAppend) {
578
        if (c.length == 1) {
579
            return;
580
        }
581
        StringBuffer sb = new StringBuffer (new String(c));
582
        for (int i=c.length-1; i >= 1; i-=1) {
583
            sb.insert (i, '-');
584
        }
585
        sb.append (toAppend);
586
        l.add (sb.toString());
587
    }
588
        
471
589
472
    private static DataObject findForAction (DataFolder actionsFolder, Action a) {
590
    private static DataObject findForAction (DataFolder actionsFolder, Action a) {
473
        if (actionsFolder == null) {
591
        if (actionsFolder == null) {
(-)core/src/org/netbeans/core/modules/Module.java (+12 lines)
Lines 438-443 Link Here
438
                    throw new IllegalArgumentException("Duplicate entries in OpenIDE-Module-Provides: " + providesS); // NOI18N
438
                    throw new IllegalArgumentException("Duplicate entries in OpenIDE-Module-Provides: " + providesS); // NOI18N
439
                }
439
                }
440
            }
440
            }
441
            String[] additionalProvides = mgr.refineProvides (this);
442
            if (additionalProvides != null) {
443
                if (provides == null) {
444
                    provides = additionalProvides;
445
                } else {
446
                    ArrayList l = new ArrayList ();
447
                    l.addAll (Arrays.asList (provides));
448
                    l.addAll (Arrays.asList (additionalProvides));
449
                    provides = (String[])l.toArray (provides);
450
                }
451
            }
452
            
441
            // Exports
453
            // Exports
442
            String exportsS = attr.getValue("OpenIDE-Module-Public-Packages"); // NOI18N
454
            String exportsS = attr.getValue("OpenIDE-Module-Public-Packages"); // NOI18N
443
            if (exportsS != null) {
455
            if (exportsS != null) {
(-)core/src/org/netbeans/core/modules/ModuleInstaller.java (+8 lines)
Lines 156-161 Link Here
156
    public void refineClassLoader(Module m, List parents) {
156
    public void refineClassLoader(Module m, List parents) {
157
        // do nothing
157
        // do nothing
158
    }
158
    }
159
160
    /** Optionally adds additional token for the module.
161
     * @param m the module to add token to 
162
     * @return null or list of tokens this module provides
163
     */
164
    public String[] refineProvides (Module m) {
165
        return null;
166
    }
159
    
167
    
160
    /** Is this package special in that the package domain cache should be disabled for it?
168
    /** Is this package special in that the package domain cache should be disabled for it?
161
     * The result must never change between subsequent calls for the same argument.
169
     * The result must never change between subsequent calls for the same argument.
(-)core/src/org/netbeans/core/modules/ModuleManager.java (+5 lines)
Lines 500-505 Link Here
500
    void refineDependencies(Module m, Set dependencies) {
500
    void refineDependencies(Module m, Set dependencies) {
501
        installer.refineDependencies(m, dependencies);
501
        installer.refineDependencies(m, dependencies);
502
    }
502
    }
503
    /** Allows the installer to add provides (used to provide name of platform we run on)
504
     */
505
    String[] refineProvides (Module m) {
506
        return installer.refineProvides (m);
507
    }
503
    /** Used by Module to communicate with the ModuleInstaller re. classloader. */
508
    /** Used by Module to communicate with the ModuleInstaller re. classloader. */
504
    void refineClassLoader(Module m, List parents) {
509
    void refineClassLoader(Module m, List parents) {
505
        // #27853:
510
        // #27853:
(-)core/src/org/netbeans/core/modules/NbInstaller.java (+22 lines)
Lines 721-726 Link Here
721
        }
721
        }
722
    }
722
    }
723
    
723
    
724
    public String[] refineProvides (Module m) {
725
        if (m.getCodeNameBase ().equals ("org.openide")) { // NOI18N
726
            ArrayList tokens = new ArrayList ();
727
            if (org.openide.util.Utilities.isUnix ()) {
728
                tokens.add ("org.openide.modules.os.Unix"); // NOI18N
729
            } 
730
            
731
            if (org.openide.util.Utilities.isWindows ()) {
732
                tokens.add ("org.openide.modules.os.Windows"); // NOI18N
733
            } 
734
            
735
            if ((org.openide.util.Utilities.getOperatingSystem () & org.openide.util.Utilities.OS_MAC) != 0) {
736
                tokens.add ("org.openide.modules.os.MacOSX"); // NOI18N
737
            }
738
            
739
            return tokens.isEmpty() ? null : (String[])tokens.toArray (new String[0]);
740
            
741
        }
742
        return null;
743
    }
744
    
745
    
724
    private void addLoadersRecursively(List parents, Dependency[] deps, Set parentModules, Module master, Set addedParentNames) {
746
    private void addLoadersRecursively(List parents, Dependency[] deps, Set parentModules, Module master, Set addedParentNames) {
725
        for (int i = 0; i < deps.length; i++) {
747
        for (int i = 0; i < deps.length; i++) {
726
            if (deps[i].getType() != Dependency.TYPE_MODULE) {
748
            if (deps[i].getType() != Dependency.TYPE_MODULE) {
(-)core/ui/src/org/netbeans/core/ui/MenuWarmUpTask.java (-29 lines)
Lines 43-77 Link Here
43
43
44
    private Component[] comps;
44
    private Component[] comps;
45
    
45
    
46
    /**
47
     * Issue 32733 - the keyboard shortcut for FIND will use this method to
48
     * determine its visibility.  For non-solaris operating systems, there is
49
     * no find key (XXX ask the HP folks about VMS), so that shouldn't be the
50
     * shortcut displayed in the menu.
51
     *
52
     * While this method doesn't really belong in a warmup task, it's silly to
53
     * create an extra class just for this sort of thing.
54
     */
55
    public static boolean isNotSolaris() {
56
        return Utilities.getOperatingSystem() != Utilities.OS_SOLARIS;
57
    }
58
    
59
    /**
60
     * Used to determine whether to bind Delete or Backspace to DeleteAction -
61
     * mac keyboards don't have a delete key.
62
     */
63
    public static boolean isMac() {
64
        return Utilities.getOperatingSystem() == Utilities.OS_MAC;
65
    }
66
    
67
    /**
68
     * Used to determine whether to bind Delete or Backspace to DeleteAction -
69
     * mac keyboards don't have a delete key.
70
     */
71
    public static boolean isNotMac() {
72
        return !isMac();
73
    }
74
75
    /** Actually performs pre-heat.
46
    /** Actually performs pre-heat.
76
     */
47
     */
77
    public void run() {
48
    public void run() {
(-)core/ui/src/org/netbeans/core/ui/resources/layer.xml (-20 / +10 lines)
Lines 238-244 Link Here
238
    </folder> <!-- Toolbars -->
238
    </folder> <!-- Toolbars -->
239
    
239
    
240
    <folder name="Shortcuts">
240
    <folder name="Shortcuts">
241
        <file name="C-Z.instance">
241
        <file name="D-Z.instance">
242
	    <attr name="instanceClass" stringvalue="org.openide.actions.UndoAction"/>
242
	    <attr name="instanceClass" stringvalue="org.openide.actions.UndoAction"/>
243
	</file>
243
	</file>
244
244
Lines 248-268 Link Here
248
248
249
        <file name="DELETE.instance">
249
        <file name="DELETE.instance">
250
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
250
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
251
            <!-- Hide on mac - macs don't have a Delete key -->
252
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isMac"/> 
253
	</file>
251
	</file>
254
        
252
        
255
        <file name="BACK_SPACE.instance">
253
        <file name="D-Y.instance">
256
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
257
            <!-- Show on mac - macs don't have a Delete key, it should be bound to backspace  -->
258
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isNotMac"/> 
259
        </file>
260
261
        <file name="C-Y.instance">
262
	    <attr name="instanceClass" stringvalue="org.openide.actions.RedoAction"/>
254
	    <attr name="instanceClass" stringvalue="org.openide.actions.RedoAction"/>
263
	</file>
255
	</file>
264
256
265
        <file name="C-X.instance">
257
        <file name="D-X.instance">
266
	    <attr name="instanceClass" stringvalue="org.openide.actions.CutAction"/>
258
	    <attr name="instanceClass" stringvalue="org.openide.actions.CutAction"/>
267
	</file>
259
	</file>
268
260
Lines 274-280 Link Here
274
	    <attr name="instanceClass" stringvalue="org.openide.actions.GotoAction"/>
266
	    <attr name="instanceClass" stringvalue="org.openide.actions.GotoAction"/>
275
	</file>
267
	</file>
276
268
277
        <file name="C-V.instance">
269
        <file name="D-V.instance">
278
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
270
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
279
	</file>
271
	</file>
280
272
Lines 282-303 Link Here
282
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
274
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
283
	</file>
275
	</file>
284
    
276
    
285
        <file name="C-F.instance">
277
        <file name="D-F.instance">
286
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
278
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
287
	</file>
279
	</file>
288
280
289
        <file name="FIND.instance">
281
        <file name="FIND.instance">
290
            <!-- #32733 - Find shortcut should be CTRL-F unless kbd has a Find key -->
291
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isNotSolaris"/> 
292
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
282
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
293
	</file>
283
	</file>
294
        
284
        
295
    
285
    
296
        <file name="C-S.instance">
286
        <file name="D-S.instance">
297
	    <attr name="instanceClass" stringvalue="org.openide.actions.SaveAction"/>
287
	    <attr name="instanceClass" stringvalue="org.openide.actions.SaveAction"/>
298
	</file>
288
	</file>
299
289
300
        <file name="C-C.instance">
290
        <file name="D-C.instance">
301
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
291
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
302
	</file>
292
	</file>
303
293
Lines 305-322 Link Here
305
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
295
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
306
	</file>
296
	</file>
307
    
297
    
308
        <file name="C-H.instance">
298
        <file name="D-H.instance">
309
	    <attr name="instanceClass" stringvalue="org.openide.actions.ReplaceAction"/>
299
	    <attr name="instanceClass" stringvalue="org.openide.actions.ReplaceAction"/>
310
	</file>
300
	</file>
311
301
312
        <file name="C-P.instance">
302
        <file name="D-P.instance">
313
	    <attr name="instanceClass" stringvalue="org.openide.actions.PrintAction"/>
303
	    <attr name="instanceClass" stringvalue="org.openide.actions.PrintAction"/>
314
	</file>
304
	</file>
315
305
316
        <file name="S-F10.instance">
306
        <file name="S-F10.instance">
317
	    <attr name="instanceClass" stringvalue="org.openide.actions.PopupAction"/>
307
	    <attr name="instanceClass" stringvalue="org.openide.actions.PopupAction"/>
318
	</file>
308
	</file>
319
        <file name="C-S-7.instance">
309
        <file name="D-S-7.instance">
320
	    <attr name="instanceClass" stringvalue="org.netbeans.core.actions.GlobalPropertiesAction"/>
310
	    <attr name="instanceClass" stringvalue="org.netbeans.core.actions.GlobalPropertiesAction"/>
321
	</file>
311
	</file>
322
    </folder>
312
    </folder>
(-)core/windows/src/org/netbeans/core/windows/resources/layer.xml (-6 / +7 lines)
Lines 130-143 Link Here
130
    </folder>
130
    </folder>
131
    
131
    
132
    <folder name="Shortcuts">
132
    <folder name="Shortcuts">
133
        <!-- The pair below used on non-mac platforms -->
133
        <file name="A-LEFT.shadow">
134
        <file name="A-LEFT.shadow">
134
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-PreviousTabAction.instance" />
135
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-PreviousTabAction.instance" />
135
        </file>
136
        </file>
136
        <file name="A-RIGHT.shadow">
137
        <file name="A-RIGHT.shadow">
137
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-NextTabAction.instance"/>
138
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-NextTabAction.instance"/>
138
	</file>
139
	</file>
139
140
        
140
        <file name="C-F4.shadow">
141
        <file name="D-F4.shadow">
141
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-CloseWindowAction.instance"/>
142
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-CloseWindowAction.instance"/>
142
	</file>
143
	</file>
143
        
144
        
Lines 148-165 Link Here
148
        <file name="S-ESCAPE.shadow">
149
        <file name="S-ESCAPE.shadow">
149
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-MaximizeWindowAction.instance"/>
150
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-MaximizeWindowAction.instance"/>
150
	</file>
151
	</file>
151
        <file name="C-TAB.shadow">
152
        <file name="D-TAB.shadow">
152
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-RecentViewListAction.instance"/>
153
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-RecentViewListAction.instance"/>
153
        </file>
154
        </file>
154
        <!-- #41477: For KDE on unixes, C-TAB is occupied by OS, so we also register C-BAKC_QUOTE as recent view list action shortcut.
155
        <!-- #41477: For KDE on unixes, C-TAB is occupied by OS, so we also register C-BAKC_QUOTE as recent view list action shortcut.
155
                     For other OS's, C-TAB is the only default !-->
156
                     For other OS's, C-TAB is the only default !-->
156
        <file name="C-BACK_QUOTE.shadow">
157
        <file name="D-BACK_QUOTE.shadow">
157
            <attr name="originalFile" methodvalue="org.netbeans.core.windows.actions.RecentViewListAction.getStringRep4Unixes"/>
158
            <attr name="originalFile" methodvalue="org.netbeans.core.windows.actions.RecentViewListAction.getStringRep4Unixes"/>
158
        </file>
159
        </file>
159
        <file name="C-0.shadow">
160
        <file name="C-D.shadow">
160
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-SwitchToRecentDocumentAction.instance"/>
161
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-SwitchToRecentDocumentAction.instance"/>
161
        </file>
162
        </file>
162
        <file name="CS-F4.shadow">
163
        <file name="D-S-F4.shadow">
163
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-CloseAllDocumentsAction.instance"/>
164
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-CloseAllDocumentsAction.instance"/>
164
        </file>
165
        </file>
165
        <file name="S-F4.shadow">
166
        <file name="S-F4.shadow">
(-)debuggerjpda/ui/src/org/netbeans/modules/debugger/jpda/resources/mf-layer.xml (-6 / +6 lines)
Lines 188-200 Link Here
188
    </folder>
188
    </folder>
189
189
190
    <folder name="Shortcuts">
190
    <folder name="Shortcuts">
191
        <file name="CS-F8.shadow">
191
        <file name="DS-F8.shadow">
192
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-AddBreakpointAction.instance"/>
192
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-AddBreakpointAction.instance"/>
193
        </file>
193
        </file>
194
        <file name="CS-F7.shadow">
194
        <file name="DS-F7.shadow">
195
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-AddWatchAction.instance"/>
195
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-AddWatchAction.instance"/>
196
        </file>
196
        </file>
197
        <file name="C-F8.shadow">
197
        <file name="D-F8.shadow">
198
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-ToggleBreakpointAction.instance"/>
198
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-ToggleBreakpointAction.instance"/>
199
        </file>
199
        </file>
200
        <file name="F4.shadow">
200
        <file name="F4.shadow">
Lines 209-224 Link Here
209
        <file name="F8.shadow">
209
        <file name="F8.shadow">
210
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-StepOverAction.instance"/>
210
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-StepOverAction.instance"/>
211
        </file>
211
        </file>
212
        <file name="C-F5.shadow">
212
        <file name="D-F5.shadow">
213
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-ContinueAction.instance"/>
213
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-ContinueAction.instance"/>
214
        </file>
214
        </file>
215
        <file name="S-F5.shadow">
215
        <file name="S-F5.shadow">
216
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-KillAction.instance"/>
216
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-KillAction.instance"/>
217
        </file>
217
        </file>
218
        <file name="CA-UP.shadow">
218
        <file name="DA-UP.shadow">
219
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-MakeCalleeCurrentAction.instance"/>
219
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-MakeCalleeCurrentAction.instance"/>
220
        </file>
220
        </file>
221
        <file name="CA-DOWN.shadow">
221
        <file name="DA-DOWN.shadow">
222
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-MakeCallerCurrentAction.instance"/>
222
            <attr name="originalFile" stringvalue="Actions/Debug/org-netbeans-modules-debugger-ui-actions-MakeCallerCurrentAction.instance"/>
223
        </file>
223
        </file>
224
        <file name="SA-4.shadow">
224
        <file name="SA-4.shadow">
(-)editor/libsrc/org/netbeans/editor/SettingsDefaults.java (-47 / +63 lines)
Lines 191-196 Link Here
191
          SettingsNames.STATUS_BAR_BOLD_COLORING
191
          SettingsNames.STATUS_BAR_BOLD_COLORING
192
      };
192
      };
193
193
194
    
195
    private static final int FIND_NEXT_KEY = 
196
        System.getProperty("mrj.version") == null ?
197
        KeyEvent.VK_F3 : KeyEvent.VK_G;
198
        
199
    private static final int FIND_NEXT_MASK = 
200
        System.getProperty("mrj.version") == null ?
201
        0 : KeyEvent.META_DOWN_MASK;
202
203
    //#26854 - use Command, not Ctrl, on mac    
204
    private static final int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
205
    
206
    //Default behavior on mac is that alt+arrows is word jumps
207
    private static final int WORD_SELECT_MASK = System.getProperty("mrj.version") == null ?
208
        InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
209
        
194
    public static final MultiKeyBinding[] defaultKeyBindings
210
    public static final MultiKeyBinding[] defaultKeyBindings
195
    = new MultiKeyBinding[] {
211
    = new MultiKeyBinding[] {
196
          new MultiKeyBinding(
212
          new MultiKeyBinding(
Lines 202-208 Link Here
202
              BaseKit.insertBreakAction
218
              BaseKit.insertBreakAction
203
          ),
219
          ),
204
          new MultiKeyBinding(
220
          new MultiKeyBinding(
205
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_MASK),
221
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, MENU_MASK),
206
              BaseKit.splitLineAction
222
              BaseKit.splitLineAction
207
          ),
223
          ),
208
          new MultiKeyBinding(
224
          new MultiKeyBinding(
Lines 234-240 Link Here
234
              BaseKit.deletePrevCharAction
250
              BaseKit.deletePrevCharAction
235
          ),
251
          ),
236
/*          new MultiKeyBinding(
252
/*          new MultiKeyBinding(
237
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
253
              KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK | InputEvent.SHIFT_MASK),
238
              BaseKit.deletePrevCharAction
254
              BaseKit.deletePrevCharAction
239
          ),
255
          ),
240
*/          new MultiKeyBinding(
256
*/          new MultiKeyBinding(
Lines 254-264 Link Here
254
              BaseKit.selectionForwardAction
270
              BaseKit.selectionForwardAction
255
          ),
271
          ),
256
          new MultiKeyBinding(
272
          new MultiKeyBinding(
257
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK),
273
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, WORD_SELECT_MASK),
258
              BaseKit.nextWordAction
274
              BaseKit.nextWordAction
259
          ),
275
          ),
260
          new MultiKeyBinding(
276
          new MultiKeyBinding(
261
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
277
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
262
              BaseKit.selectionNextWordAction
278
              BaseKit.selectionNextWordAction
263
          ),
279
          ),
264
          new MultiKeyBinding(
280
          new MultiKeyBinding(
Lines 270-284 Link Here
270
              BaseKit.backwardAction
286
              BaseKit.backwardAction
271
          ),
287
          ),
272
          new MultiKeyBinding(
288
          new MultiKeyBinding(
273
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK),
289
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,  InputEvent.SHIFT_MASK),
274
              BaseKit.selectionBackwardAction
290
              BaseKit.selectionBackwardAction
275
          ),
291
          ),
276
          new MultiKeyBinding(
292
          new MultiKeyBinding(
277
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK),
293
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, WORD_SELECT_MASK),
278
              BaseKit.previousWordAction
294
              BaseKit.previousWordAction
279
          ),
295
          ),
280
          new MultiKeyBinding(
296
          new MultiKeyBinding(
281
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
297
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
282
              BaseKit.selectionPreviousWordAction
298
              BaseKit.selectionPreviousWordAction
283
          ),
299
          ),
284
          new MultiKeyBinding(
300
          new MultiKeyBinding(
Lines 294-300 Link Here
294
              BaseKit.selectionDownAction
310
              BaseKit.selectionDownAction
295
          ),
311
          ),
296
          new MultiKeyBinding(
312
          new MultiKeyBinding(
297
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK),
313
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, MENU_MASK),
298
              BaseKit.scrollUpAction
314
              BaseKit.scrollUpAction
299
          ),
315
          ),
300
          new MultiKeyBinding(
316
          new MultiKeyBinding(
Lines 310-316 Link Here
310
              BaseKit.selectionUpAction
326
              BaseKit.selectionUpAction
311
          ),
327
          ),
312
          new MultiKeyBinding(
328
          new MultiKeyBinding(
313
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK),
329
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, MENU_MASK),
314
              BaseKit.scrollDownAction
330
              BaseKit.scrollDownAction
315
          ),
331
          ),
316
          new MultiKeyBinding(
332
          new MultiKeyBinding(
Lines 338-348 Link Here
338
              BaseKit.selectionBeginLineAction
354
              BaseKit.selectionBeginLineAction
339
          ),
355
          ),
340
          new MultiKeyBinding(
356
          new MultiKeyBinding(
341
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.CTRL_MASK),
357
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, MENU_MASK),
342
              BaseKit.beginAction
358
              BaseKit.beginAction
343
          ),
359
          ),
344
          new MultiKeyBinding(
360
          new MultiKeyBinding(
345
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
361
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | MENU_MASK),
346
              BaseKit.selectionBeginAction
362
              BaseKit.selectionBeginAction
347
          ),
363
          ),
348
          new MultiKeyBinding(
364
          new MultiKeyBinding(
Lines 354-374 Link Here
354
              BaseKit.selectionEndLineAction
370
              BaseKit.selectionEndLineAction
355
          ),
371
          ),
356
          new MultiKeyBinding(
372
          new MultiKeyBinding(
357
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.CTRL_MASK),
373
              KeyStroke.getKeyStroke(KeyEvent.VK_END, MENU_MASK),
358
              BaseKit.endAction
374
              BaseKit.endAction
359
          ),
375
          ),
360
          new MultiKeyBinding(
376
          new MultiKeyBinding(
361
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
377
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | MENU_MASK),
362
              BaseKit.selectionEndAction
378
              BaseKit.selectionEndAction
363
          ),
379
          ),
364
380
365
          // clipboard bindings
381
          // clipboard bindings
366
          new MultiKeyBinding(
382
          new MultiKeyBinding(
367
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
383
              KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK),
368
              BaseKit.copyAction
384
              BaseKit.copyAction
369
          ),
385
          ),
370
          new MultiKeyBinding(
386
          new MultiKeyBinding(
371
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.CTRL_MASK),
387
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, MENU_MASK),
372
              BaseKit.copyAction
388
              BaseKit.copyAction
373
          ),
389
          ),
374
          new MultiKeyBinding(
390
          new MultiKeyBinding(
Lines 380-386 Link Here
380
              BaseKit.cutAction
396
              BaseKit.cutAction
381
          ),
397
          ),
382
          new MultiKeyBinding(
398
          new MultiKeyBinding(
383
              KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK),
399
              KeyStroke.getKeyStroke(KeyEvent.VK_X, MENU_MASK),
384
              BaseKit.cutAction
400
              BaseKit.cutAction
385
          ),
401
          ),
386
          new MultiKeyBinding(
402
          new MultiKeyBinding(
Lines 388-394 Link Here
388
              BaseKit.cutAction
404
              BaseKit.cutAction
389
          ),
405
          ),
390
          new MultiKeyBinding(
406
          new MultiKeyBinding(
391
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
407
              KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK),
392
              BaseKit.pasteAction
408
              BaseKit.pasteAction
393
          ),
409
          ),
394
          new MultiKeyBinding(
410
          new MultiKeyBinding(
Lines 400-412 Link Here
400
              BaseKit.pasteAction
416
              BaseKit.pasteAction
401
          ),
417
          ),
402
          new MultiKeyBinding(
418
          new MultiKeyBinding(
403
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
419
              KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK | InputEvent.SHIFT_MASK),
404
              BaseKit.pasteFormatedAction
420
              BaseKit.pasteFormatedAction
405
          ),
421
          ),
406
422
407
          // undo and redo bindings - handled at system level
423
          // undo and redo bindings - handled at system level
408
          new MultiKeyBinding(
424
          new MultiKeyBinding(
409
              KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK),
425
              KeyStroke.getKeyStroke(KeyEvent.VK_Z, MENU_MASK),
410
              BaseKit.undoAction
426
              BaseKit.undoAction
411
          ),
427
          ),
412
          new MultiKeyBinding(
428
          new MultiKeyBinding(
Lines 414-426 Link Here
414
              BaseKit.undoAction
430
              BaseKit.undoAction
415
          ),
431
          ),
416
          new MultiKeyBinding(
432
          new MultiKeyBinding(
417
              KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK),
433
              KeyStroke.getKeyStroke(KeyEvent.VK_Y, MENU_MASK),
418
              BaseKit.redoAction
434
              BaseKit.redoAction
419
          ),
435
          ),
420
436
421
          // other bindings
437
          // other bindings
422
          new MultiKeyBinding(
438
          new MultiKeyBinding(
423
              KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK),
439
              KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK),
424
              BaseKit.selectAllAction
440
              BaseKit.selectAllAction
425
          ),
441
          ),
426
          new MultiKeyBinding(
442
          new MultiKeyBinding(
Lines 431-445 Link Here
431
              BaseKit.endWordAction
447
              BaseKit.endWordAction
432
          ),
448
          ),
433
          new MultiKeyBinding(
449
          new MultiKeyBinding(
434
              KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_MASK),
450
              KeyStroke.getKeyStroke(KeyEvent.VK_W, MENU_MASK),
435
              BaseKit.removeWordAction
451
              BaseKit.removeWordAction
436
          ),
452
          ),
437
          new MultiKeyBinding(
453
          new MultiKeyBinding(
438
              KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK),
454
              KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
439
              BaseKit.removeLineBeginAction
455
              BaseKit.removeLineBeginAction
440
          ),
456
          ),
441
          new MultiKeyBinding(
457
          new MultiKeyBinding(
442
              KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK),
458
              KeyStroke.getKeyStroke(KeyEvent.VK_E, MENU_MASK),
443
              BaseKit.removeLineAction
459
              BaseKit.removeLineAction
444
          ),
460
          ),
445
          new MultiKeyBinding(
461
          new MultiKeyBinding(
Lines 447-453 Link Here
447
              BaseKit.toggleTypingModeAction
463
              BaseKit.toggleTypingModeAction
448
          ),
464
          ),
449
          new MultiKeyBinding(
465
          new MultiKeyBinding(
450
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK),
466
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, MENU_MASK),
451
              BaseKit.toggleBookmarkAction
467
              BaseKit.toggleBookmarkAction
452
          ),
468
          ),
453
          new MultiKeyBinding(
469
          new MultiKeyBinding(
Lines 455-469 Link Here
455
              BaseKit.gotoNextBookmarkAction
471
              BaseKit.gotoNextBookmarkAction
456
          ),
472
          ),
457
          new MultiKeyBinding(
473
          new MultiKeyBinding(
458
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0),
474
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK),
459
              BaseKit.findNextAction
475
              BaseKit.findNextAction
460
          ),
476
          ),
461
          new MultiKeyBinding(
477
          new MultiKeyBinding(
462
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK),
478
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.SHIFT_MASK),
463
              BaseKit.findPreviousAction
479
              BaseKit.findPreviousAction
464
          ),
480
          ),
465
          new MultiKeyBinding(
481
          new MultiKeyBinding(
466
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.CTRL_MASK),
482
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.CTRL_MASK),
467
              BaseKit.findSelectionAction
483
              BaseKit.findSelectionAction
468
          ),
484
          ),
469
          new MultiKeyBinding(
485
          new MultiKeyBinding(
Lines 471-489 Link Here
471
              BaseKit.toggleHighlightSearchAction
487
              BaseKit.toggleHighlightSearchAction
472
          ),
488
          ),
473
          new MultiKeyBinding(
489
          new MultiKeyBinding(
474
              KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_MASK),
490
              KeyStroke.getKeyStroke(KeyEvent.VK_L, MENU_MASK),
475
              BaseKit.wordMatchNextAction
491
              BaseKit.wordMatchNextAction
476
          ),
492
          ),
477
          new MultiKeyBinding(
493
          new MultiKeyBinding(
478
              KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.CTRL_MASK),
494
              KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK),
479
              BaseKit.wordMatchPrevAction
495
              BaseKit.wordMatchPrevAction
480
          ),
496
          ),
481
          new MultiKeyBinding(
497
          new MultiKeyBinding(
482
              KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK),
498
              KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK),
483
              BaseKit.shiftLineRightAction
499
              BaseKit.shiftLineRightAction
484
          ),
500
          ),
485
          new MultiKeyBinding(
501
          new MultiKeyBinding(
486
              KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK),
502
              KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK),
487
              BaseKit.shiftLineLeftAction
503
              BaseKit.shiftLineLeftAction
488
          ),
504
          ),
489
          new MultiKeyBinding(
505
          new MultiKeyBinding(
Lines 491-497 Link Here
491
              BaseKit.abbrevResetAction
507
              BaseKit.abbrevResetAction
492
          ),
508
          ),
493
          new MultiKeyBinding(
509
          new MultiKeyBinding(
494
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
510
              KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK | InputEvent.SHIFT_MASK),
495
              BaseKit.annotationsCyclingAction
511
              BaseKit.annotationsCyclingAction
496
          ),
512
          ),
497
513
Lines 531-537 Link Here
531
          ),
547
          ),
532
548
533
          new MultiKeyBinding(
549
          new MultiKeyBinding(
534
              KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK ),
550
              KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK | InputEvent.SHIFT_MASK ),
535
              BaseKit.formatAction
551
              BaseKit.formatAction
536
          ),
552
          ),
537
          new MultiKeyBinding(
553
          new MultiKeyBinding(
Lines 577-589 Link Here
577
          ),
593
          ),
578
594
579
          new MultiKeyBinding(
595
          new MultiKeyBinding(
580
              KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_MASK),
596
              KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK),
581
              BaseKit.selectNextParameterAction
597
              BaseKit.selectNextParameterAction
582
          ),
598
          ),
583
599
584
          new MultiKeyBinding(
600
          new MultiKeyBinding(
585
              new KeyStroke[] {
601
              new KeyStroke[] {
586
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
602
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
587
                  KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
603
                  KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
588
              },
604
              },
589
              BaseKit.startMacroRecordingAction
605
              BaseKit.startMacroRecordingAction
Lines 591-649 Link Here
591
607
592
          new MultiKeyBinding(
608
          new MultiKeyBinding(
593
              new KeyStroke[] {
609
              new KeyStroke[] {
594
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
610
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
595
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
611
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
596
              },
612
              },
597
              BaseKit.stopMacroRecordingAction
613
              BaseKit.stopMacroRecordingAction
598
          ),
614
          ),
599
          
615
          
600
          new MultiKeyBinding(
616
          new MultiKeyBinding(
601
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK),
617
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK),
602
              BaseKit.collapseFoldAction
618
              BaseKit.collapseFoldAction
603
          ),
619
          ),
604
620
605
          new MultiKeyBinding(
621
          new MultiKeyBinding(
606
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK),
622
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK),
607
              BaseKit.expandFoldAction
623
              BaseKit.expandFoldAction
608
          ),
624
          ),
609
          
625
          
610
          new MultiKeyBinding(
626
          new MultiKeyBinding(
611
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
627
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK | InputEvent.SHIFT_MASK),
612
              BaseKit.collapseAllFoldsAction
628
              BaseKit.collapseAllFoldsAction
613
          ),
629
          ),
614
          
630
          
615
          new MultiKeyBinding(
631
          new MultiKeyBinding(
616
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
632
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK | InputEvent.SHIFT_MASK),
617
              BaseKit.expandAllFoldsAction
633
              BaseKit.expandAllFoldsAction
618
          ),
634
          ),
619
635
620
          new MultiKeyBinding(
636
          new MultiKeyBinding(
621
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK),
637
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK),
622
              BaseKit.collapseFoldAction
638
              BaseKit.collapseFoldAction
623
          ),
639
          ),
624
640
625
          new MultiKeyBinding(
641
          new MultiKeyBinding(
626
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK),
642
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK),
627
              BaseKit.expandFoldAction
643
              BaseKit.expandFoldAction
628
          ),
644
          ),
629
645
630
          new MultiKeyBinding(
646
          new MultiKeyBinding(
631
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK),
647
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK),
632
              BaseKit.expandFoldAction
648
              BaseKit.expandFoldAction
633
          ),
649
          ),
634
650
635
          new MultiKeyBinding(
651
          new MultiKeyBinding(
636
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
652
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK | InputEvent.SHIFT_MASK),
637
              BaseKit.collapseAllFoldsAction
653
              BaseKit.collapseAllFoldsAction
638
          ),
654
          ),
639
          
655
          
640
          new MultiKeyBinding(
656
          new MultiKeyBinding(
641
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
657
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK | InputEvent.SHIFT_MASK),
642
              BaseKit.expandAllFoldsAction
658
              BaseKit.expandAllFoldsAction
643
          ),
659
          ),
644
          
660
          
645
          new MultiKeyBinding(
661
          new MultiKeyBinding(
646
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
662
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK | InputEvent.SHIFT_MASK),
647
              BaseKit.expandAllFoldsAction
663
              BaseKit.expandAllFoldsAction
648
          ),
664
          ),
649
          
665
          
(-)editor/libsrc/org/netbeans/editor/ext/ExtSettingsDefaults.java (-6 / +7 lines)
Lines 72-77 Link Here
72
    public static final Integer defaultJavaDocAutoPopupDelay = new Integer(200);
72
    public static final Integer defaultJavaDocAutoPopupDelay = new Integer(200);
73
    public static final Dimension defaultJavaDocPreferredSize = new Dimension(500, 300);    
73
    public static final Dimension defaultJavaDocPreferredSize = new Dimension(500, 300);    
74
    public static final Boolean defaultJavaDocAutoPopup = Boolean.TRUE;
74
    public static final Boolean defaultJavaDocAutoPopup = Boolean.TRUE;
75
    private static int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
75
    
76
    
76
    public static final MultiKeyBinding[] defaultExtKeyBindings
77
    public static final MultiKeyBinding[] defaultExtKeyBindings
77
    = new MultiKeyBinding[] {
78
    = new MultiKeyBinding[] {
Lines 80-86 Link Here
80
              ExtKit.gotoDeclarationAction
81
              ExtKit.gotoDeclarationAction
81
          ),
82
          ),
82
          new MultiKeyBinding(
83
          new MultiKeyBinding(
83
              KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK),
84
              KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK),
84
              ExtKit.findAction
85
              ExtKit.findAction
85
          ),
86
          ),
86
          new MultiKeyBinding(
87
          new MultiKeyBinding(
Lines 88-94 Link Here
88
              ExtKit.findAction
89
              ExtKit.findAction
89
          ),
90
          ),
90
          new MultiKeyBinding(
91
          new MultiKeyBinding(
91
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK),
92
              KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK),
92
              ExtKit.replaceAction
93
              ExtKit.replaceAction
93
          ),
94
          ),
94
          new MultiKeyBinding(
95
          new MultiKeyBinding(
Lines 108-118 Link Here
108
              ExtKit.escapeAction
109
              ExtKit.escapeAction
109
          ),
110
          ),
110
          new MultiKeyBinding(
111
          new MultiKeyBinding(
111
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, InputEvent.CTRL_MASK),
112
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK),
112
              ExtKit.matchBraceAction
113
              ExtKit.matchBraceAction
113
          ),
114
          ),
114
          new MultiKeyBinding(
115
          new MultiKeyBinding(
115
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
116
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK | InputEvent.SHIFT_MASK),
116
              ExtKit.selectionMatchBraceAction
117
              ExtKit.selectionMatchBraceAction
117
          ),
118
          ),
118
          new MultiKeyBinding(
119
          new MultiKeyBinding(
Lines 120-127 Link Here
120
              ExtKit.showPopupMenuAction
121
              ExtKit.showPopupMenuAction
121
          ),
122
          ),
122
          /*      new MultiKeyBinding(
123
          /*      new MultiKeyBinding(
123
                    KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK),
124
                    KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
124
          //          KeyStroke.getKeyStroke(KeyEvent.VK_BRACELEFT, InputEvent.CTRL_MASK),
125
          //          KeyStroke.getKeyStroke(KeyEvent.VK_BRACELEFT, MENU_MASK),
125
                    ExtKit.braceCodeSelectAction
126
                    ExtKit.braceCodeSelectAction
126
                ),
127
                ),
127
          */
128
          */
(-)editor/libsrc/org/netbeans/editor/ext/java/JavaSettingsDefaults.java (-3 / +5 lines)
Lines 154-173 Link Here
154
    }
154
    }
155
155
156
    public static MultiKeyBinding[] getJavaKeyBindings() {
156
    public static MultiKeyBinding[] getJavaKeyBindings() {
157
        int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
158
        
157
        return new MultiKeyBinding[] {
159
        return new MultiKeyBinding[] {
158
                   new MultiKeyBinding(
160
                   new MultiKeyBinding(
159
                       new KeyStroke[] {
161
                       new KeyStroke[] {
160
                           KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
162
                           KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
161
                           KeyStroke.getKeyStroke(KeyEvent.VK_D, 0)
163
                           KeyStroke.getKeyStroke(KeyEvent.VK_D, 0)
162
                       },
164
                       },
163
                       "macro-debug-var"
165
                       "macro-debug-var"
164
                   ),
166
                   ),
165
                   new MultiKeyBinding(
167
                   new MultiKeyBinding(
166
                       KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
168
                       KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK | InputEvent.SHIFT_MASK),
167
                       ExtKit.commentAction
169
                       ExtKit.commentAction
168
                   ),
170
                   ),
169
                  new MultiKeyBinding(
171
                  new MultiKeyBinding(
170
                      KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
172
                      KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK | InputEvent.SHIFT_MASK),
171
                      ExtKit.uncommentAction
173
                      ExtKit.uncommentAction
172
                  )
174
                  )
173
               };
175
               };
(-)editor/src/org/netbeans/modules/editor/java/NbJavaSettingsInitializer.java (-5 / +7 lines)
Lines 13-18 Link Here
13
13
14
package org.netbeans.modules.editor.java;
14
package org.netbeans.modules.editor.java;
15
15
16
import java.awt.Toolkit;
16
import java.awt.event.KeyEvent;
17
import java.awt.event.KeyEvent;
17
import java.awt.event.InputEvent;
18
import java.awt.event.InputEvent;
18
import java.util.Map;
19
import java.util.Map;
Lines 98-103 Link Here
98
    }
99
    }
99
100
100
    public MultiKeyBinding[] getJavaKeyBindings() {
101
    public MultiKeyBinding[] getJavaKeyBindings() {
102
        int mask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
101
        return new MultiKeyBinding[] {
103
        return new MultiKeyBinding[] {
102
                   new MultiKeyBinding(
104
                   new MultiKeyBinding(
103
                       new KeyStroke[] {
105
                       new KeyStroke[] {
Lines 127-133 Link Here
127
                   ),
129
                   ),
128
                   new MultiKeyBinding(
130
                   new MultiKeyBinding(
129
                       KeyStroke.getKeyStroke(KeyEvent.VK_B,
131
                       KeyStroke.getKeyStroke(KeyEvent.VK_B,
130
                           InputEvent.CTRL_MASK),
132
                           mask),
131
                       JavaKit.gotoSuperImplementationAction
133
                       JavaKit.gotoSuperImplementationAction
132
                   ),
134
                   ),
133
                   new MultiKeyBinding(
135
                   new MultiKeyBinding(
Lines 137-161 Link Here
137
                   ),
139
                   ),
138
//                   new MultiKeyBinding(
140
//                   new MultiKeyBinding(
139
//                       KeyStroke.getKeyStroke(KeyEvent.VK_S,
141
//                       KeyStroke.getKeyStroke(KeyEvent.VK_S,
140
//                           InputEvent.ALT_MASK | InputEvent.CTRL_MASK),
142
//                           InputEvent.ALT_MASK | mask),
141
//                       JavaKit.tryCatchAction
143
//                       JavaKit.tryCatchAction
142
//                       ),
144
//                       ),
143
145
144
                   new MultiKeyBinding(
146
                   new MultiKeyBinding(
145
                       KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
147
                       KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
146
                           InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
148
                           mask | InputEvent.SHIFT_MASK),
147
                       JavaKit.javaDocShowAction
149
                       JavaKit.javaDocShowAction
148
                   ),
150
                   ),
149
                   
151
                   
150
                   new MultiKeyBinding(
152
                   new MultiKeyBinding(
151
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
153
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
152
                           InputEvent.CTRL_MASK | InputEvent.ALT_MASK),
154
                           mask | InputEvent.ALT_MASK),
153
                       JavaKit.selectNextElementAction
155
                       JavaKit.selectNextElementAction
154
                   ),
156
                   ),
155
                   
157
                   
156
                   new MultiKeyBinding(
158
                   new MultiKeyBinding(
157
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
159
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
158
                           InputEvent.CTRL_MASK | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
160
                           mask | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
159
                       JavaKit.selectPreviousElementAction
161
                       JavaKit.selectPreviousElementAction
160
                   )
162
                   )
161
                   
163
                   
(-)form/src/org/netbeans/modules/form/resources/layer.xml (-1 / +1 lines)
Lines 460-466 Link Here
460
    </folder>
460
    </folder>
461
461
462
    <folder name="Shortcuts">
462
    <folder name="Shortcuts">
463
        <file name="C-R.instance">
463
        <file name="D-R.instance">
464
            <attr name="instanceClass" stringvalue="org.netbeans.modules.form.actions.ReloadAction"/>
464
            <attr name="instanceClass" stringvalue="org.netbeans.modules.form.actions.ReloadAction"/>
465
        </file>
465
        </file>
466
        
466
        
(-)i18n/src/org/netbeans/modules/i18n/Layer.xml (-1 / +1 lines)
Lines 16-22 Link Here
16
<filesystem>
16
<filesystem>
17
17
18
    <folder name="Shortcuts">
18
    <folder name="Shortcuts">
19
        <file name="CS-J.instance">
19
        <file name="DS-J.instance">
20
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.i18n.InsertI18nStringAction"/>
20
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.i18n.InsertI18nStringAction"/>
21
	</file>
21
	</file>
22
    </folder>
22
    </folder>
(-)ide/applemenu/manifest.mf (+1 lines)
Lines 4-9 Link Here
4
OpenIDE-Module-Install: org/netbeans/modules/applemenu/Install.class
4
OpenIDE-Module-Install: org/netbeans/modules/applemenu/Install.class
5
OpenIDE-Module-Layer: org/netbeans/modules/applemenu/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/applemenu/layer.xml
6
OpenIDE-Module-Specification-Version: 1.1
6
OpenIDE-Module-Specification-Version: 1.1
7
OpenIDE-Module-Requires: org.openide.modules.os.MacOSX
7
8
8
9
9
10
(-)ide/applemenu/nbproject/project.properties (+1 lines)
Lines 11-13 Link Here
11
11
12
nbm.needs.restart=true
12
nbm.needs.restart=true
13
cp.extra=eawtstub/dist/eawtstub.jar
13
cp.extra=eawtstub/dist/eawtstub.jar
14
is.eager=true
(-)ide/applemenu/src/org/netbeans/modules/applemenu/layer.xml (+18 lines)
Lines 37-42 Link Here
37
-->        
37
-->        
38
    </folder>
38
    </folder>
39
    
39
    
40
    <folder name="Shortcuts">
41
        <file name="BACK_SPACE.instance">
42
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
43
        </file>
40
44
45
        <!-- On the mac, alt left-right is select, etc. next/prev word-->
46
        <file name="M-LEFT.shadow">
47
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-PreviousTabAction.instance" />
48
        </file>
49
        <file name="M-RIGHT.shadow">
50
	    <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-windows-actions-NextTabAction.instance"/>
51
	</file>
52
53
        <!-- The pair below used on non-mac platforms -->
54
        <file name="A-LEFT.shadow_hidden"/>
55
        <file name="A-RIGHT.shadow_hidden"/>
56
        
57
            
58
    </folder>
41
59
42
</filesystem>
60
</filesystem>
(-)java/src/org/netbeans/modules/java/resources/mf-layer.xml (-1 / +1 lines)
Lines 147-153 Link Here
147
  </folder>
147
  </folder>
148
148
149
  <folder name="Shortcuts">
149
  <folder name="Shortcuts">
150
    <file name="C-I.shadow">
150
    <file name="D-I.shadow">
151
        <attr name="originalFile" stringvalue="Actions/Tools/org-netbeans-modules-java-tools-OverrideAction.instance"/>
151
        <attr name="originalFile" stringvalue="Actions/Tools/org-netbeans-modules-java-tools-OverrideAction.instance"/>
152
    </file>
152
    </file>
153
  </folder>
153
  </folder>
(-)junit/src/org/netbeans/modules/junit/resources/layer.xml (-2 / +2 lines)
Lines 80-89 Link Here
80
80
81
    <!-- shortcuts -->
81
    <!-- shortcuts -->
82
    <folder name="Shortcuts">
82
    <folder name="Shortcuts">
83
        <file name="CA-J.instance">
83
        <file name="DA-J.instance">
84
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.junit.CreateTestAction"/>
84
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.junit.CreateTestAction"/>
85
	</file>
85
	</file>
86
        <file name="CA-K.instance">
86
        <file name="DA-K.instance">
87
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.junit.OpenTestAction"/>
87
	    <attr name="instanceClass" stringvalue="org.netbeans.modules.junit.OpenTestAction"/>
88
	</file>
88
	</file>
89
    </folder>
89
    </folder>
(-)monitor/src/org/netbeans/modules/web/monitor/resources/layer.xml (-1 / +1 lines)
Lines 33-39 Link Here
33
  </folder>
33
  </folder>
34
34
35
    <folder name="Shortcuts">
35
    <folder name="Shortcuts">
36
        <file name="C-7.instance">
36
        <file name="D-7.instance">
37
            <attr name="instanceClass" stringvalue="org.netbeans.modules.web.monitor.client.MonitorAction" />
37
            <attr name="instanceClass" stringvalue="org.netbeans.modules.web.monitor.client.MonitorAction" />
38
        </file>
38
        </file>
39
    </folder>
39
    </folder>
(-)openide/src/org/openide/util/Utilities.java (+47 lines)
Lines 1252-1258 Link Here
1252
                } else {
1252
                } else {
1253
                    // last text must be the key code
1253
                    // last text must be the key code
1254
                    Integer i = (Integer)names.get (el);
1254
                    Integer i = (Integer)names.get (el);
1255
                    boolean wildcard = (needed & WILDCARD_MASK) != 0;
1256
                    //Strip out the explicit mask - KeyStroke won't know
1257
                    //what to do with it
1258
                    needed = needed & ~WILDCARD_MASK;
1259
                    
1255
                    if (i != null) {
1260
                    if (i != null) {
1261
                        //#26854 - Default accelerator should be Command on mac
1262
                        if (wildcard) {
1263
                            needed |= Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
1264
                            if ((getOperatingSystem() & OS_MAC) != 0) {
1265
                                if (!usableKeyOnMac(i.intValue(), needed)) {
1266
                                    needed &= ~Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
1267
                                    needed |= KeyEvent.CTRL_MASK;
1268
                                }
1269
                            }
1270
                        }
1256
                        return KeyStroke.getKeyStroke (i.intValue (), needed);
1271
                        return KeyStroke.getKeyStroke (i.intValue (), needed);
1257
                    } else {
1272
                    } else {
1258
                        return null;
1273
                        return null;
Lines 1263-1268 Link Here
1263
            return null;
1278
            return null;
1264
        }
1279
        }
1265
    }
1280
    }
1281
    
1282
    private static final boolean usableKeyOnMac (int key, int mask) {
1283
        //All permutations fail for Q except ctrl
1284
        if (key == KeyEvent.VK_Q) return false;
1285
        
1286
        boolean isMeta = ((mask & KeyEvent.META_MASK) != 0) || 
1287
            ((mask & KeyEvent.CTRL_DOWN_MASK) != 0);
1288
        
1289
        boolean isAlt = ((mask & KeyEvent.ALT_MASK) != 0) || 
1290
            ((mask & KeyEvent.ALT_DOWN_MASK) != 0);
1291
        
1292
        boolean isOnlyMeta = isMeta && (mask & ~(KeyEvent.META_DOWN_MASK | KeyEvent.META_MASK)) == 0;
1293
        
1294
        //Mac OS consumes keys Command+ these keys - the app will never see
1295
        //them, so CTRL should not be remapped for these
1296
        if (isOnlyMeta) {
1297
            return key != KeyEvent.VK_H && key != 
1298
                KeyEvent.VK_SPACE && key != KeyEvent.VK_TAB;
1299
        } else if (key == KeyEvent.VK_D && isMeta && isAlt) {
1300
            return false;
1301
        } else {
1302
            return true;
1303
        }
1304
    }
1266
1305
1267
    /** Convert a space-separated list of user-friendly key binding names to a list of Swing key strokes.
1306
    /** Convert a space-separated list of user-friendly key binding names to a list of Swing key strokes.
1268
    * @param s the string with keys
1307
    * @param s the string with keys
Lines 1283-1288 Link Here
1283
        return (KeyStroke[])arr.toArray (new KeyStroke[arr.size ()]);
1322
        return (KeyStroke[])arr.toArray (new KeyStroke[arr.size ()]);
1284
    }
1323
    }
1285
1324
1325
    private static final int WILDCARD_MASK = 32768;
1286
1326
1287
    /** Adds characters for modifiers to the buffer.
1327
    /** Adds characters for modifiers to the buffer.
1288
    * @param buf buffer to add to
1328
    * @param buf buffer to add to
Lines 1308-1313 Link Here
1308
            buf.append("M"); // NOI18N
1348
            buf.append("M"); // NOI18N
1309
            b = true;
1349
            b = true;
1310
        }
1350
        }
1351
        if ((modif & WILDCARD_MASK) != 0) {
1352
            buf.append("D");
1353
            b = true;
1354
        }
1311
1355
1312
        return b;
1356
        return b;
1313
    }
1357
    }
Lines 1332-1337 Link Here
1332
                break;
1376
                break;
1333
            case 'S':
1377
            case 'S':
1334
                m |= KeyEvent.SHIFT_MASK;
1378
                m |= KeyEvent.SHIFT_MASK;
1379
                break;
1380
            case 'D':
1381
                m |= WILDCARD_MASK;
1335
                break;
1382
                break;
1336
            default:
1383
            default:
1337
                throw new NoSuchElementException ();
1384
                throw new NoSuchElementException ();
(-)projects/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml (-10 / +10 lines)
Lines 499-529 Link Here
499
    
499
    
500
    <folder name="Shortcuts">
500
    <folder name="Shortcuts">
501
    
501
    
502
        <file name="CS-N.shadow">
502
        <file name="DS-N.shadow">
503
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewProject.instance"/>
503
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewProject.instance"/>
504
	</file>
504
	</file>
505
        
505
        
506
        <file name="C-N.shadow">
506
        <file name="D-N.shadow">
507
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewFile.instance"/>
507
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewFile.instance"/>
508
	</file>
508
	</file>
509
        
509
        
510
        <file name="CS-O.shadow">
510
        <file name="DS-O.shadow">
511
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-OpenProject.instance"/>
511
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-OpenProject.instance"/>
512
	</file>
512
	</file>
513
    
513
    
514
        <file name="C-1.shadow">
514
        <file name="D-1.shadow">
515
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-logical-tab-action.instance"/>
515
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-logical-tab-action.instance"/>
516
        </file>
516
        </file>
517
517
518
        <file name="C-2.shadow">
518
        <file name="D-2.shadow">
519
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-physical-tab-action.instance"/>
519
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-physical-tab-action.instance"/>
520
	</file>
520
	</file>
521
521
522
        <file name="CS-1.shadow">
522
        <file name="DS-1.shadow">
523
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInProjects.instance"/>
523
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInProjects.instance"/>
524
	</file>
524
	</file>
525
        
525
        
526
        <file name="CS-2.shadow">
526
        <file name="DS-2.shadow">
527
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInFiles.instance"/>
527
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInFiles.instance"/>
528
	</file>
528
	</file>
529
        
529
        
Lines 547-561 Link Here
547
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RunSingle.instance"/>
547
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RunSingle.instance"/>
548
	</file>
548
	</file>
549
        
549
        
550
        <file name="CS-F5.shadow">
550
        <file name="DS-F5.shadow">
551
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugSingle.instance"/>
551
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugSingle.instance"/>
552
	</file>
552
	</file>
553
        
553
        
554
        <file name="C-F6.shadow">
554
        <file name="D-F6.shadow">
555
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-TestSingle.instance"/>
555
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-TestSingle.instance"/>
556
	</file>
556
	</file>
557
        
557
        
558
        <file name="CS-F6.shadow">
558
        <file name="DS-F6.shadow">
559
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugTestSingle.instance"/>
559
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugTestSingle.instance"/>
560
	</file>
560
	</file>
561
        
561
        
(-)utilities/project/src/org/netbeans/modules/search/project/layer.xml (-1 / +1 lines)
Lines 33-39 Link Here
33
    </folder> <!-- Menu -->
33
    </folder> <!-- Menu -->
34
    
34
    
35
    <folder name="Shortcuts">
35
    <folder name="Shortcuts">
36
        <file name="CS-P.shadow">
36
        <file name="DS-P.shadow">
37
            <attr name="originalFile" stringvalue="Actions/Edit/org-netbeans-modules-search-project-ProjectsSearchAction.instance"/>
37
            <attr name="originalFile" stringvalue="Actions/Edit/org-netbeans-modules-search-project-ProjectsSearchAction.instance"/>
38
        </file>
38
        </file>
39
    </folder>
39
    </folder>
(-)utilities/src/org/netbeans/modules/utilities/Layer.xml (-2 / +2 lines)
Lines 186-195 Link Here
186
    </folder> <!-- Menu -->
186
    </folder> <!-- Menu -->
187
187
188
    <folder name="Shortcuts">
188
    <folder name="Shortcuts">
189
        <file name="C-O.instance">
189
        <file name="D-O.instance">
190
    	    <attr name="instanceClass" stringvalue="org.netbeans.modules.openfile.OpenFileAction"/>
190
    	    <attr name="instanceClass" stringvalue="org.netbeans.modules.openfile.OpenFileAction"/>
191
	</file>
191
	</file>
192
        <file name="CS-0.shadow">
192
        <file name="DS-0.shadow">
193
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-search-ResultViewOpenAction.instance"/>
193
            <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-modules-search-ResultViewOpenAction.instance"/>
194
        </file>
194
        </file>
195
    </folder> <!-- Shortcuts -->
195
    </folder> <!-- Shortcuts -->
(-)vcscore/src/org/netbeans/modules/vcscore/resources/mf-layer.xml (-3 / +3 lines)
Lines 52-64 Link Here
52
  </folder>
52
  </folder>
53
  
53
  
54
  <folder name="Shortcuts">
54
  <folder name="Shortcuts">
55
      <file name="C-8.instance">
55
      <file name="D-8.instance">
56
          <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.OpenVersioningAction" />
56
          <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.OpenVersioningAction" />
57
      </file>
57
      </file>
58
      <file name="CS-8.instance">
58
      <file name="DS-8.instance">
59
          <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.VersioningAction" />
59
          <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.VersioningAction" />
60
      </file>
60
      </file>
61
      <file name="C-9.instance">
61
      <file name="D-9.instance">
62
        <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.VcsOutputAction" />
62
        <attr name="instanceClass" stringvalue="org.netbeans.modules.vcscore.actions.VcsOutputAction" />
63
      </file>
63
      </file>
64
  </folder>
64
  </folder>

Return to bug 46811