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 (-2 / +129 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 69-75 Link Here
69
    
71
    
70
72
71
    /** Creates new ShortcutsFolder */
73
    /** Creates new ShortcutsFolder */
72
    private ShortcutsFolder(DataFolder f) {
74
    ShortcutsFolder(DataFolder f) {
73
        super(f);
75
        super(f);
74
        recreate();
76
        recreate();
75
    }
77
    }
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
    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
            } else {
534
                idx = name.indexOf ("D"); //NOI18N
535
                if (idx != -1) {
536
                    StringBuffer sb = new StringBuffer(modsPart);
537
                    sb.replace(idx, idx+1, key);
538
                    perms.add (sb.toString() + keyPart);
539
                    getAllPossibleOrderings (sb.toString(), keyPart, perms);
540
                    createHyphenatedPermutation(sb.toString().toCharArray(), perms, keyPart);
541
                }
542
            }
543
            getAllPossibleOrderings (modsPart, keyPart, perms);
544
            createHyphenatedPermutation(modsPart.toCharArray(), perms, keyPart);
545
            return (String[]) perms.toArray(new String[perms.size()]);
546
        } else {
547
            return "C".equals (modsPart) ?
548
                new String[] {"D" + keyPart} : new String[0];
549
        }
550
    }
551
    
552
    /**
553
     * Retrieves all the possible orders for the passed in string, and puts them
554
     * in the passed collection, appending <code>toAppend</code> to each.
555
     */
556
    static void getAllPossibleOrderings (String s, String toAppend, final Collection store) {
557
        char[] c = s.toCharArray();
558
        mutate (c, store, 0, toAppend);
559
        String[] result = (String[]) store.toArray(new String[store.size()]);
560
    }   
561
    
562
    /**
563
     * Recursively generates all possible orderings of the passed char array
564
     */
565
    private static void mutate(char[] c, Collection l, int n, String toAppend) {
566
        if (n == c.length) {
567
            l.add (new String(c) + toAppend);
568
            createHyphenatedPermutation(c, l, toAppend);
569
            return;
570
        }
571
        //XXX could be optimized to eliminate duplicates
572
        for (int i=0; i < c.length; i++) {
573
            char x = c[i];
574
            c[i] = c[n];
575
            c[n] = x;
576
            if (n < c.length) { 
577
                mutate (c, l, n+1, toAppend);
578
            } 
579
        }
580
    }
581
    
582
    /**
583
     * Inserts "-" characters between each character in the char array and
584
     * adds the result + toAppend to the collection.
585
     */
586
    static void createHyphenatedPermutation (char[] c, Collection l, String toAppend) {
587
        if (c.length == 1) {
588
            return;
589
        }
590
        StringBuffer sb = new StringBuffer (new String(c));
591
        for (int i=c.length-1; i >= 1; i-=1) {
592
            sb.insert (i, '-');
593
        }
594
        sb.append (toAppend);
595
        l.add (sb.toString());
596
    }
597
        
471
598
472
    private static DataObject findForAction (DataFolder actionsFolder, Action a) {
599
    private static DataObject findForAction (DataFolder actionsFolder, Action a) {
473
        if (actionsFolder == null) {
600
        if (actionsFolder == null) {
(-)core/test/unit/src/org/netbeans/core/ShortcutsFolderTest.java (+326 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
package org.netbeans.core;
14
15
import java.awt.Toolkit;
16
import java.awt.event.ActionEvent;
17
import java.awt.event.KeyEvent;
18
import java.io.File;
19
import java.io.IOException;
20
import java.lang.ref.WeakReference;
21
import java.util.Arrays;
22
import java.util.Collection;
23
import java.util.Collections;
24
import java.util.Enumeration;
25
import java.util.HashSet;
26
import java.util.MissingResourceException;
27
import java.util.Properties;
28
import java.util.ResourceBundle;
29
import java.util.StringTokenizer;
30
import javax.swing.AbstractAction;
31
import javax.swing.Action;
32
import javax.swing.KeyStroke;
33
import junit.framework.*;
34
import org.netbeans.junit.*;
35
import org.openide.ErrorManager;
36
import org.openide.cookies.InstanceCookie;
37
import org.openide.filesystems.FileObject;
38
import org.openide.filesystems.FileSystem;
39
import org.openide.filesystems.LocalFileSystem;
40
import org.openide.filesystems.Repository;
41
import org.openide.loaders.DataFolder;
42
import org.openide.loaders.DataObject;
43
import org.openide.util.Lookup;
44
import org.openide.util.LookupListener;
45
import org.openide.util.Utilities;
46
import junit.textui.TestRunner;
47
48
/**
49
 * Tests shortcuts folder to ensure it handles wildcard keystrokes correctly. 
50
 */
51
public class ShortcutsFolderTest extends NbTestCase {
52
    /** Use for internal test execution inside IDE
53
     * @param args command line arguments
54
     */
55
    public static void main(String[] args) {
56
        TestRunner.run(new NbTestSuite(ShortcutsFolderTest.class));
57
    }
58
    
59
    /** Constructor required by JUnit.
60
     * @param testName method name to be used as testcase
61
     */
62
    public ShortcutsFolderTest(String s) {
63
        super(s);
64
    }
65
    
66
    public void testHyphenation (String s) {
67
        HashSet set = new HashSet();
68
        char[] c = new String("ABCD").toCharArray();
69
        ShortcutsFolder.createHyphenatedPermutation (c, set, "-F5");
70
        
71
        assertTrue (set.contains("A-B-C-D-F5"));
72
    }
73
    
74
    public void testPermutations () {
75
        HashSet set = new HashSet();
76
        
77
        ShortcutsFolder.getAllPossibleOrderings("BANG", "-F5", set);
78
        String[] permutations = new String[] {
79
            "BNAG", "BNGA", "BGNA", "BAGN", "BGAN", 
80
            "ANBG", "ABGN", "AGBN", "ANGB", "ABNG", "AGNB",
81
            "NBGA", "NGBA", "NABG", "NGAB", "NBAG", "NAGB",
82
            "GNAB", "GBAN", "GBNA", "GNBA", "GANB", "GABN",
83
        };
84
        
85
        for (int i=0; i < permutations.length; i++) {
86
            assertTrue ("Permutation of BANG not generated: " + permutations[i], 
87
                set.contains(permutations[i] + "-F5"));
88
        }
89
    }
90
    
91
    public void testPermutationsIncludeHyphenatedVariants() {
92
        HashSet set = new HashSet();
93
        
94
        ShortcutsFolder.getAllPossibleOrderings("BANG", "-F5", set);
95
        String[] permutations = new String[] {
96
            "B-N-A-G", "B-N-G-A", "B-G-N-A", "B-A-G-N", "B-G-A-N", 
97
            "A-N-B-G", "A-B-G-N", "A-G-B-N", "A-N-G-B", "A-B-N-G", "A-G-N-B",
98
            "N-B-G-A", "N-G-B-A", "N-A-B-G", "N-G-A-B", "N-B-A-G", "N-A-G-B",
99
            "G-N-A-B", "G-B-A-N", "G-B-N-A", "G-N-B-A", "G-A-N-B", "G-A-B-N",
100
        };
101
        
102
        for (int i=0; i < permutations.length; i++) {
103
            assertTrue ("Permutation of BANG not generated: " + permutations[i], 
104
                set.contains(permutations[i] + "-F5"));
105
        }
106
    }
107
    
108
    public void testPermutationsContainConvertedWildcard () {
109
        String targetChar = (Utilities.getOperatingSystem() & Utilities.OS_MAC) != 0
110
            ? "M" : "C";
111
        
112
        String[] s = ShortcutsFolder.getPermutations("DA-F5");
113
        HashSet set = new HashSet (Arrays.asList(s));
114
        set.add ("DA-F5"); //Permutations will not contain the passed value
115
        
116
        String[] permutations = new String[] {
117
            targetChar+"A-F5", "A" + targetChar + "-F5",
118
            targetChar+"-A-F5", "A-" + targetChar + "-F5",
119
            "AD-F5", "A-D-F5", "D-A-F5"
120
        };
121
        
122
        for (int i=0; i < permutations.length; i++) {
123
            assertTrue ("Permutation of DA-F5 not generated:" 
124
                + permutations[i] + "-(generated:" + set + ")",
125
                set.contains(permutations[i]));
126
        }
127
    }
128
129
    public void testPermutationsIncludeWildcardIfSpecifiedKeyIsToolkitAccelerator () {
130
        String targetChar = (Utilities.getOperatingSystem() & Utilities.OS_MAC) != 0
131
            ? "M" : "C";
132
        
133
        String[] s = ShortcutsFolder.getPermutations(targetChar + "A-F5");
134
        
135
        String[] permutations = new String[] {
136
            "A" + targetChar + "-F5", "A-" + targetChar + "-F5",
137
            "DA-F5", "D-A-F5"
138
        };
139
        
140
        HashSet set = new HashSet (Arrays.asList(s));
141
        set.add (targetChar + "A-F5"); //Permutations will not contain the passed value
142
        
143
        for (int i=0; i < permutations.length; i++) {
144
            assertTrue ("Permutation of " + targetChar + "A-F5 not generated:" 
145
                + permutations[i] + "-(generated:" + set + ")", 
146
                set.contains(permutations[i].intern()));
147
        }
148
    } 
149
    
150
    private static String lastDir = null;
151
    private File getTempDir() {
152
        String outdir = System.getProperty("java.io.tmpdir"); //NOI18N
153
        if (!outdir.endsWith(File.separator)) {
154
            outdir += File.separator;
155
        }
156
        String dirname = Long.toHexString(System.currentTimeMillis());
157
        lastDir = outdir + dirname + File.separator;
158
        File dir = new File (outdir + dirname);
159
        try {
160
            dir.mkdir();
161
        } catch (Exception ioe) {
162
            ioe.printStackTrace();
163
            fail ("Exception creating temporary dir for tests " + dirname + " - " + ioe.getMessage());
164
        }
165
        dir.deleteOnExit();
166
        return dir;
167
    }
168
    
169
    private static Repository repository = null;
170
    private FileSystem createTestingFilesystem () {
171
        try {
172
            LocalFileSystem result = new LocalFileSystem();
173
            result.setRootDirectory(getTempDir());
174
            repository = new Repository (result);
175
            System.setProperty ("org.openide.util.Lookup", "org.netbeans.core.ShortcutsFolderTest$LKP");
176
            return result;
177
        } catch (Exception e) {
178
            e.printStackTrace();
179
            fail (e.getMessage());
180
        }
181
        return null;
182
    }
183
    
184
    private FileObject getFolderForShortcuts(FileSystem fs) {
185
        FileObject result = null;
186
        try {
187
            result = fs.getRoot().getFileObject("Shortcuts");
188
            if (result == null) {
189
                result = fs.getRoot().createFolder("Shortcuts");
190
            }
191
        } catch (Exception e) {
192
            e.printStackTrace();
193
            fail(e.getMessage());
194
        }
195
        return result;
196
    }
197
    
198
    private ShortcutsFolder createShortcutsFolder(FileSystem fs) {
199
        try {
200
            DataObject dob = DataObject.find(getFolderForShortcuts(fs));
201
            ShortcutsFolder result = new ShortcutsFolder ((DataFolder)dob);
202
            ShortcutsFolder.shortcutsFolder = result;
203
            return result;
204
        } catch (Exception e) {
205
            e.printStackTrace();
206
            fail ("Exception creating shortcuts folder on " + fs);
207
            return null;
208
        }
209
    }
210
    
211
    public void testShortcutsFolderDeletesShortcutWhenNameIsMisordered() throws Exception {
212
        FileSystem fs = createTestingFilesystem();
213
        FileObject fo = getFolderForShortcuts(fs);
214
        
215
        FileObject data1 = fo.createData("AD-F5.instance");
216
        assertNotNull(data1);
217
        data1.setAttribute("instanceClass", "org.netbeans.core.ShortcutsFolderTest$TestAction");
218
        
219
        FileObject data2 = fo.createData("AS-F5.instance");
220
        assertNotNull(data2);
221
        data2.setAttribute("instanceClass", "org.netbeans.core.ShortcutsFolderTest$TestAction");
222
        
223
        File file = new File (lastDir + "Shortcuts" + File.separator + "AD-F5.instance");
224
        assertTrue ("Actual file not created: " + file.getPath(), file.exists());
225
        
226
        
227
        ShortcutsFolder sf = createShortcutsFolder(fs);
228
        System.err.println("Created shortcuts folder " + sf);
229
        
230
        sf.waitShortcutsFinished();
231
        
232
        DataObject ob = DataObject.find (data1);
233
        assertNotNull("Data object not found: " + data1.getPath(), ob);
234
        System.err.println("Found data object " + data1);
235
        
236
        InstanceCookie ck = (InstanceCookie) ob.getCookie(InstanceCookie.class);
237
        Object obj = ck.instanceCreate();
238
        
239
        assertTrue ("InstanceCookie was not an instanceof TestAction - " + obj, obj instanceof TestAction);
240
        
241
        System.err.println("Got an instance: " + obj);
242
        
243
        KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_F5, KeyEvent.ALT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
244
        Action action = (Action) obj;
245
        
246
        ShortcutsFolder.applyChanges(Arrays.asList(new Object[] {new ShortcutsFolder.ChangeRequest (stroke, action, false)}));
247
        
248
        ShortcutsFolder.refreshGlobalMap();
249
250
        FileObject now = fo.getFileObject ("AD-F5.instance");
251
        assertNull ("File object should be deleted - ", now);
252
        
253
        assertFalse ("File still exists: " + lastDir + "AD-F5.instance", file.exists());
254
        
255
        file = new File (lastDir + "Shortcuts" + File.separator + "AS-F5.instance");
256
        assertTrue ("File should not have been deleted: " + file.getPath(), file.exists());
257
        
258
    }
259
    
260
    public static class TestAction extends AbstractAction {
261
        public void actionPerformed (ActionEvent ae) {}
262
    }
263
    
264
    public static class LKP extends Lookup {
265
        public Object lookup (Class clazz) {
266
            if (Repository.class == clazz) {
267
                return repository;
268
            }
269
            if (ErrorManager.class == clazz) {
270
                return new EM();
271
            }
272
            return null;
273
        }
274
        
275
        public Lookup.Result lookup (final Lookup.Template tpl) {
276
            Lookup.Result r = new Lookup.Result() {
277
                public Collection allInstances() {
278
                    if (tpl.getType() == ErrorManager.class) {
279
                        return Arrays.asList(new Object[] { new EM()});
280
                    } else {
281
                        return Collections.EMPTY_LIST;
282
                    }
283
                }
284
                
285
                public  void addLookupListener (LookupListener l) {}
286
287
                public  void removeLookupListener (LookupListener l){}                
288
            };
289
            
290
            return r;
291
        }
292
    }
293
    
294
    public static class EM extends ErrorManager {
295
        public Throwable attachAnnotations (Throwable t, Annotation[] arr) {
296
            return t;
297
        }
298
299
        public void log (int i, String s) {
300
            System.err.println(s);
301
        }
302
        
303
        public Annotation[] findAnnotations (Throwable t) {
304
            return new Annotation[0];
305
        }
306
307
        public Throwable annotate (
308
            Throwable t, int severity,
309
            String message, String localizedMessage,
310
            Throwable stackTrace, java.util.Date date
311
        ) {
312
            System.err.println(message);
313
            t.printStackTrace();
314
            return t;
315
        }
316
317
        public void notify (int severity, Throwable t) {
318
            t.printStackTrace();
319
        }
320
321
        public ErrorManager getInstance(String name) {
322
            return this;
323
        }
324
    }
325
    
326
}
(-)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 243-249 Link Here
243
    </folder> <!-- Toolbars -->
243
    </folder> <!-- Toolbars -->
244
    
244
    
245
    <folder name="Shortcuts">
245
    <folder name="Shortcuts">
246
        <file name="C-Z.instance">
246
        <file name="D-Z.instance">
247
	    <attr name="instanceClass" stringvalue="org.openide.actions.UndoAction"/>
247
	    <attr name="instanceClass" stringvalue="org.openide.actions.UndoAction"/>
248
	</file>
248
	</file>
249
249
Lines 253-273 Link Here
253
253
254
        <file name="DELETE.instance">
254
        <file name="DELETE.instance">
255
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
255
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
256
            <!-- Hide on mac - macs don't have a Delete key -->
257
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isMac"/> 
258
	</file>
256
	</file>
259
        
257
        
260
        <file name="BACK_SPACE.instance">
258
        <file name="D-Y.instance">
261
	    <attr name="instanceClass" stringvalue="org.openide.actions.DeleteAction"/>
262
            <!-- Show on mac - macs don't have a Delete key, it should be bound to backspace  -->
263
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isNotMac"/> 
264
        </file>
265
266
        <file name="C-Y.instance">
267
	    <attr name="instanceClass" stringvalue="org.openide.actions.RedoAction"/>
259
	    <attr name="instanceClass" stringvalue="org.openide.actions.RedoAction"/>
268
	</file>
260
	</file>
269
261
270
        <file name="C-X.instance">
262
        <file name="D-X.instance">
271
	    <attr name="instanceClass" stringvalue="org.openide.actions.CutAction"/>
263
	    <attr name="instanceClass" stringvalue="org.openide.actions.CutAction"/>
272
	</file>
264
	</file>
273
265
Lines 279-285 Link Here
279
	    <attr name="instanceClass" stringvalue="org.openide.actions.GotoAction"/>
271
	    <attr name="instanceClass" stringvalue="org.openide.actions.GotoAction"/>
280
	</file>
272
	</file>
281
273
282
        <file name="C-V.instance">
274
        <file name="D-V.instance">
283
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
275
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
284
	</file>
276
	</file>
285
277
Lines 287-308 Link Here
287
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
279
	    <attr name="instanceClass" stringvalue="org.openide.actions.PasteAction"/>
288
	</file>
280
	</file>
289
    
281
    
290
        <file name="C-F.instance">
282
        <file name="D-F.instance">
291
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
283
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
292
	</file>
284
	</file>
293
285
294
        <file name="FIND.instance">
286
        <file name="FIND.instance">
295
            <!-- #32733 - Find shortcut should be CTRL-F unless kbd has a Find key -->
296
            <attr name="hidden" methodvalue="org.netbeans.core.ui.MenuWarmUpTask.isNotSolaris"/> 
297
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
287
	    <attr name="instanceClass" stringvalue="org.openide.actions.FindAction"/>
298
	</file>
288
	</file>
299
        
289
        
300
    
290
    
301
        <file name="C-S.instance">
291
        <file name="D-S.instance">
302
	    <attr name="instanceClass" stringvalue="org.openide.actions.SaveAction"/>
292
	    <attr name="instanceClass" stringvalue="org.openide.actions.SaveAction"/>
303
	</file>
293
	</file>
304
294
305
        <file name="C-C.instance">
295
        <file name="D-C.instance">
306
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
296
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
307
	</file>
297
	</file>
308
298
Lines 310-327 Link Here
310
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
300
	    <attr name="instanceClass" stringvalue="org.openide.actions.CopyAction"/>
311
	</file>
301
	</file>
312
    
302
    
313
        <file name="C-H.instance">
303
        <file name="D-H.instance">
314
	    <attr name="instanceClass" stringvalue="org.openide.actions.ReplaceAction"/>
304
	    <attr name="instanceClass" stringvalue="org.openide.actions.ReplaceAction"/>
315
	</file>
305
	</file>
316
306
317
        <file name="C-P.instance">
307
        <file name="D-P.instance">
318
	    <attr name="instanceClass" stringvalue="org.openide.actions.PrintAction"/>
308
	    <attr name="instanceClass" stringvalue="org.openide.actions.PrintAction"/>
319
	</file>
309
	</file>
320
310
321
        <file name="S-F10.instance">
311
        <file name="S-F10.instance">
322
	    <attr name="instanceClass" stringvalue="org.openide.actions.PopupAction"/>
312
	    <attr name="instanceClass" stringvalue="org.openide.actions.PopupAction"/>
323
	</file>
313
	</file>
324
        <file name="C-S-7.instance">
314
        <file name="D-S-7.instance">
325
	    <attr name="instanceClass" stringvalue="org.netbeans.core.actions.GlobalPropertiesAction"/>
315
	    <attr name="instanceClass" stringvalue="org.netbeans.core.actions.GlobalPropertiesAction"/>
326
	</file>
316
	</file>
327
    </folder>
317
    </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="D-0.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 196-201 Link Here
196
          SettingsNames.STATUS_BAR_BOLD_COLORING
196
          SettingsNames.STATUS_BAR_BOLD_COLORING
197
      };
197
      };
198
198
199
    
200
    private static final int FIND_NEXT_KEY = 
201
        System.getProperty("mrj.version") == null ?
202
        KeyEvent.VK_F3 : KeyEvent.VK_G;
203
        
204
    private static final int FIND_NEXT_MASK = 
205
        System.getProperty("mrj.version") == null ?
206
        0 : KeyEvent.META_DOWN_MASK;
207
208
    //#26854 - use Command, not Ctrl, on mac    
209
    private static final int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
210
    
211
    //Default behavior on mac is that alt+arrows is word jumps
212
    private static final int WORD_SELECT_MASK = System.getProperty("mrj.version") == null ?
213
        InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
214
        
199
    public static final MultiKeyBinding[] defaultKeyBindings
215
    public static final MultiKeyBinding[] defaultKeyBindings
200
    = new MultiKeyBinding[] {
216
    = new MultiKeyBinding[] {
201
          new MultiKeyBinding(
217
          new MultiKeyBinding(
Lines 207-213 Link Here
207
              BaseKit.insertBreakAction
223
              BaseKit.insertBreakAction
208
          ),
224
          ),
209
          new MultiKeyBinding(
225
          new MultiKeyBinding(
210
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_MASK),
226
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, MENU_MASK),
211
              BaseKit.splitLineAction
227
              BaseKit.splitLineAction
212
          ),
228
          ),
213
          new MultiKeyBinding(
229
          new MultiKeyBinding(
Lines 239-245 Link Here
239
              BaseKit.deletePrevCharAction
255
              BaseKit.deletePrevCharAction
240
          ),
256
          ),
241
/*          new MultiKeyBinding(
257
/*          new MultiKeyBinding(
242
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
258
              KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK | InputEvent.SHIFT_MASK),
243
              BaseKit.deletePrevCharAction
259
              BaseKit.deletePrevCharAction
244
          ),
260
          ),
245
*/          new MultiKeyBinding(
261
*/          new MultiKeyBinding(
Lines 259-269 Link Here
259
              BaseKit.selectionForwardAction
275
              BaseKit.selectionForwardAction
260
          ),
276
          ),
261
          new MultiKeyBinding(
277
          new MultiKeyBinding(
262
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK),
278
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, WORD_SELECT_MASK),
263
              BaseKit.nextWordAction
279
              BaseKit.nextWordAction
264
          ),
280
          ),
265
          new MultiKeyBinding(
281
          new MultiKeyBinding(
266
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
282
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
267
              BaseKit.selectionNextWordAction
283
              BaseKit.selectionNextWordAction
268
          ),
284
          ),
269
          new MultiKeyBinding(
285
          new MultiKeyBinding(
Lines 275-289 Link Here
275
              BaseKit.backwardAction
291
              BaseKit.backwardAction
276
          ),
292
          ),
277
          new MultiKeyBinding(
293
          new MultiKeyBinding(
278
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK),
294
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,  InputEvent.SHIFT_MASK),
279
              BaseKit.selectionBackwardAction
295
              BaseKit.selectionBackwardAction
280
          ),
296
          ),
281
          new MultiKeyBinding(
297
          new MultiKeyBinding(
282
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK),
298
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, WORD_SELECT_MASK),
283
              BaseKit.previousWordAction
299
              BaseKit.previousWordAction
284
          ),
300
          ),
285
          new MultiKeyBinding(
301
          new MultiKeyBinding(
286
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
302
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
287
              BaseKit.selectionPreviousWordAction
303
              BaseKit.selectionPreviousWordAction
288
          ),
304
          ),
289
          new MultiKeyBinding(
305
          new MultiKeyBinding(
Lines 299-305 Link Here
299
              BaseKit.selectionDownAction
315
              BaseKit.selectionDownAction
300
          ),
316
          ),
301
          new MultiKeyBinding(
317
          new MultiKeyBinding(
302
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK),
318
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, MENU_MASK),
303
              BaseKit.scrollUpAction
319
              BaseKit.scrollUpAction
304
          ),
320
          ),
305
          new MultiKeyBinding(
321
          new MultiKeyBinding(
Lines 315-321 Link Here
315
              BaseKit.selectionUpAction
331
              BaseKit.selectionUpAction
316
          ),
332
          ),
317
          new MultiKeyBinding(
333
          new MultiKeyBinding(
318
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK),
334
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, MENU_MASK),
319
              BaseKit.scrollDownAction
335
              BaseKit.scrollDownAction
320
          ),
336
          ),
321
          new MultiKeyBinding(
337
          new MultiKeyBinding(
Lines 343-353 Link Here
343
              BaseKit.selectionBeginLineAction
359
              BaseKit.selectionBeginLineAction
344
          ),
360
          ),
345
          new MultiKeyBinding(
361
          new MultiKeyBinding(
346
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.CTRL_MASK),
362
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, MENU_MASK),
347
              BaseKit.beginAction
363
              BaseKit.beginAction
348
          ),
364
          ),
349
          new MultiKeyBinding(
365
          new MultiKeyBinding(
350
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
366
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | MENU_MASK),
351
              BaseKit.selectionBeginAction
367
              BaseKit.selectionBeginAction
352
          ),
368
          ),
353
          new MultiKeyBinding(
369
          new MultiKeyBinding(
Lines 359-379 Link Here
359
              BaseKit.selectionEndLineAction
375
              BaseKit.selectionEndLineAction
360
          ),
376
          ),
361
          new MultiKeyBinding(
377
          new MultiKeyBinding(
362
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.CTRL_MASK),
378
              KeyStroke.getKeyStroke(KeyEvent.VK_END, MENU_MASK),
363
              BaseKit.endAction
379
              BaseKit.endAction
364
          ),
380
          ),
365
          new MultiKeyBinding(
381
          new MultiKeyBinding(
366
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
382
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | MENU_MASK),
367
              BaseKit.selectionEndAction
383
              BaseKit.selectionEndAction
368
          ),
384
          ),
369
385
370
          // clipboard bindings
386
          // clipboard bindings
371
          new MultiKeyBinding(
387
          new MultiKeyBinding(
372
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
388
              KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK),
373
              BaseKit.copyAction
389
              BaseKit.copyAction
374
          ),
390
          ),
375
          new MultiKeyBinding(
391
          new MultiKeyBinding(
376
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.CTRL_MASK),
392
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, MENU_MASK),
377
              BaseKit.copyAction
393
              BaseKit.copyAction
378
          ),
394
          ),
379
          new MultiKeyBinding(
395
          new MultiKeyBinding(
Lines 385-391 Link Here
385
              BaseKit.cutAction
401
              BaseKit.cutAction
386
          ),
402
          ),
387
          new MultiKeyBinding(
403
          new MultiKeyBinding(
388
              KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK),
404
              KeyStroke.getKeyStroke(KeyEvent.VK_X, MENU_MASK),
389
              BaseKit.cutAction
405
              BaseKit.cutAction
390
          ),
406
          ),
391
          new MultiKeyBinding(
407
          new MultiKeyBinding(
Lines 393-399 Link Here
393
              BaseKit.cutAction
409
              BaseKit.cutAction
394
          ),
410
          ),
395
          new MultiKeyBinding(
411
          new MultiKeyBinding(
396
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
412
              KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK),
397
              BaseKit.pasteAction
413
              BaseKit.pasteAction
398
          ),
414
          ),
399
          new MultiKeyBinding(
415
          new MultiKeyBinding(
Lines 405-417 Link Here
405
              BaseKit.pasteAction
421
              BaseKit.pasteAction
406
          ),
422
          ),
407
          new MultiKeyBinding(
423
          new MultiKeyBinding(
408
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
424
              KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK | InputEvent.SHIFT_MASK),
409
              BaseKit.pasteFormatedAction
425
              BaseKit.pasteFormatedAction
410
          ),
426
          ),
411
427
412
          // undo and redo bindings - handled at system level
428
          // undo and redo bindings - handled at system level
413
          new MultiKeyBinding(
429
          new MultiKeyBinding(
414
              KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK),
430
              KeyStroke.getKeyStroke(KeyEvent.VK_Z, MENU_MASK),
415
              BaseKit.undoAction
431
              BaseKit.undoAction
416
          ),
432
          ),
417
          new MultiKeyBinding(
433
          new MultiKeyBinding(
Lines 419-431 Link Here
419
              BaseKit.undoAction
435
              BaseKit.undoAction
420
          ),
436
          ),
421
          new MultiKeyBinding(
437
          new MultiKeyBinding(
422
              KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK),
438
              KeyStroke.getKeyStroke(KeyEvent.VK_Y, MENU_MASK),
423
              BaseKit.redoAction
439
              BaseKit.redoAction
424
          ),
440
          ),
425
441
426
          // other bindings
442
          // other bindings
427
          new MultiKeyBinding(
443
          new MultiKeyBinding(
428
              KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK),
444
              KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK),
429
              BaseKit.selectAllAction
445
              BaseKit.selectAllAction
430
          ),
446
          ),
431
          new MultiKeyBinding(
447
          new MultiKeyBinding(
Lines 436-450 Link Here
436
              BaseKit.endWordAction
452
              BaseKit.endWordAction
437
          ),
453
          ),
438
          new MultiKeyBinding(
454
          new MultiKeyBinding(
439
              KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_MASK),
455
              KeyStroke.getKeyStroke(KeyEvent.VK_W, MENU_MASK),
440
              BaseKit.removeWordAction
456
              BaseKit.removeWordAction
441
          ),
457
          ),
442
          new MultiKeyBinding(
458
          new MultiKeyBinding(
443
              KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK),
459
              KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
444
              BaseKit.removeLineBeginAction
460
              BaseKit.removeLineBeginAction
445
          ),
461
          ),
446
          new MultiKeyBinding(
462
          new MultiKeyBinding(
447
              KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK),
463
              KeyStroke.getKeyStroke(KeyEvent.VK_E, MENU_MASK),
448
              BaseKit.removeLineAction
464
              BaseKit.removeLineAction
449
          ),
465
          ),
450
          new MultiKeyBinding(
466
          new MultiKeyBinding(
Lines 452-458 Link Here
452
              BaseKit.toggleTypingModeAction
468
              BaseKit.toggleTypingModeAction
453
          ),
469
          ),
454
          new MultiKeyBinding(
470
          new MultiKeyBinding(
455
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK),
471
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, MENU_MASK),
456
              BaseKit.toggleBookmarkAction
472
              BaseKit.toggleBookmarkAction
457
          ),
473
          ),
458
          new MultiKeyBinding(
474
          new MultiKeyBinding(
Lines 460-474 Link Here
460
              BaseKit.gotoNextBookmarkAction
476
              BaseKit.gotoNextBookmarkAction
461
          ),
477
          ),
462
          new MultiKeyBinding(
478
          new MultiKeyBinding(
463
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0),
479
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK),
464
              BaseKit.findNextAction
480
              BaseKit.findNextAction
465
          ),
481
          ),
466
          new MultiKeyBinding(
482
          new MultiKeyBinding(
467
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK),
483
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.SHIFT_MASK),
468
              BaseKit.findPreviousAction
484
              BaseKit.findPreviousAction
469
          ),
485
          ),
470
          new MultiKeyBinding(
486
          new MultiKeyBinding(
471
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.CTRL_MASK),
487
              KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.CTRL_MASK),
472
              BaseKit.findSelectionAction
488
              BaseKit.findSelectionAction
473
          ),
489
          ),
474
          new MultiKeyBinding(
490
          new MultiKeyBinding(
Lines 476-494 Link Here
476
              BaseKit.toggleHighlightSearchAction
492
              BaseKit.toggleHighlightSearchAction
477
          ),
493
          ),
478
          new MultiKeyBinding(
494
          new MultiKeyBinding(
479
              KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_MASK),
495
              KeyStroke.getKeyStroke(KeyEvent.VK_L, MENU_MASK),
480
              BaseKit.wordMatchNextAction
496
              BaseKit.wordMatchNextAction
481
          ),
497
          ),
482
          new MultiKeyBinding(
498
          new MultiKeyBinding(
483
              KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.CTRL_MASK),
499
              KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK),
484
              BaseKit.wordMatchPrevAction
500
              BaseKit.wordMatchPrevAction
485
          ),
501
          ),
486
          new MultiKeyBinding(
502
          new MultiKeyBinding(
487
              KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK),
503
              KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK),
488
              BaseKit.shiftLineRightAction
504
              BaseKit.shiftLineRightAction
489
          ),
505
          ),
490
          new MultiKeyBinding(
506
          new MultiKeyBinding(
491
              KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK),
507
              KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK),
492
              BaseKit.shiftLineLeftAction
508
              BaseKit.shiftLineLeftAction
493
          ),
509
          ),
494
          new MultiKeyBinding(
510
          new MultiKeyBinding(
Lines 496-502 Link Here
496
              BaseKit.abbrevResetAction
512
              BaseKit.abbrevResetAction
497
          ),
513
          ),
498
          new MultiKeyBinding(
514
          new MultiKeyBinding(
499
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
515
              KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK | InputEvent.SHIFT_MASK),
500
              BaseKit.annotationsCyclingAction
516
              BaseKit.annotationsCyclingAction
501
          ),
517
          ),
502
518
Lines 536-542 Link Here
536
          ),
552
          ),
537
553
538
          new MultiKeyBinding(
554
          new MultiKeyBinding(
539
              KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK ),
555
              KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK | InputEvent.SHIFT_MASK ),
540
              BaseKit.formatAction
556
              BaseKit.formatAction
541
          ),
557
          ),
542
          new MultiKeyBinding(
558
          new MultiKeyBinding(
Lines 582-594 Link Here
582
          ),
598
          ),
583
599
584
          new MultiKeyBinding(
600
          new MultiKeyBinding(
585
              KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_MASK),
601
              KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK),
586
              BaseKit.selectNextParameterAction
602
              BaseKit.selectNextParameterAction
587
          ),
603
          ),
588
604
589
          new MultiKeyBinding(
605
          new MultiKeyBinding(
590
              new KeyStroke[] {
606
              new KeyStroke[] {
591
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
607
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
592
                  KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
608
                  KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
593
              },
609
              },
594
              BaseKit.startMacroRecordingAction
610
              BaseKit.startMacroRecordingAction
Lines 596-654 Link Here
596
612
597
          new MultiKeyBinding(
613
          new MultiKeyBinding(
598
              new KeyStroke[] {
614
              new KeyStroke[] {
599
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
615
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
600
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
616
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
601
              },
617
              },
602
              BaseKit.stopMacroRecordingAction
618
              BaseKit.stopMacroRecordingAction
603
          ),
619
          ),
604
          
620
          
605
          new MultiKeyBinding(
621
          new MultiKeyBinding(
606
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK),
622
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK),
607
              BaseKit.collapseFoldAction
623
              BaseKit.collapseFoldAction
608
          ),
624
          ),
609
625
610
          new MultiKeyBinding(
626
          new MultiKeyBinding(
611
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK),
627
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK),
612
              BaseKit.expandFoldAction
628
              BaseKit.expandFoldAction
613
          ),
629
          ),
614
          
630
          
615
          new MultiKeyBinding(
631
          new MultiKeyBinding(
616
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
632
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK | InputEvent.SHIFT_MASK),
617
              BaseKit.collapseAllFoldsAction
633
              BaseKit.collapseAllFoldsAction
618
          ),
634
          ),
619
          
635
          
620
          new MultiKeyBinding(
636
          new MultiKeyBinding(
621
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
637
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK | InputEvent.SHIFT_MASK),
622
              BaseKit.expandAllFoldsAction
638
              BaseKit.expandAllFoldsAction
623
          ),
639
          ),
624
640
625
          new MultiKeyBinding(
641
          new MultiKeyBinding(
626
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK),
642
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK),
627
              BaseKit.collapseFoldAction
643
              BaseKit.collapseFoldAction
628
          ),
644
          ),
629
645
630
          new MultiKeyBinding(
646
          new MultiKeyBinding(
631
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK),
647
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK),
632
              BaseKit.expandFoldAction
648
              BaseKit.expandFoldAction
633
          ),
649
          ),
634
650
635
          new MultiKeyBinding(
651
          new MultiKeyBinding(
636
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK),
652
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK),
637
              BaseKit.expandFoldAction
653
              BaseKit.expandFoldAction
638
          ),
654
          ),
639
655
640
          new MultiKeyBinding(
656
          new MultiKeyBinding(
641
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
657
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK | InputEvent.SHIFT_MASK),
642
              BaseKit.collapseAllFoldsAction
658
              BaseKit.collapseAllFoldsAction
643
          ),
659
          ),
644
          
660
          
645
          new MultiKeyBinding(
661
          new MultiKeyBinding(
646
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
662
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK | InputEvent.SHIFT_MASK),
647
              BaseKit.expandAllFoldsAction
663
              BaseKit.expandAllFoldsAction
648
          ),
664
          ),
649
          
665
          
650
          new MultiKeyBinding(
666
          new MultiKeyBinding(
651
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
667
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK | InputEvent.SHIFT_MASK),
652
              BaseKit.expandAllFoldsAction
668
              BaseKit.expandAllFoldsAction
653
          ),
669
          ),
654
          
670
          
(-)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 81-87 Link Here
81
          ),
82
          ),
82
           */
83
           */
83
          new MultiKeyBinding(
84
          new MultiKeyBinding(
84
              KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK),
85
              KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK),
85
              ExtKit.findAction
86
              ExtKit.findAction
86
          ),
87
          ),
87
          new MultiKeyBinding(
88
          new MultiKeyBinding(
Lines 89-95 Link Here
89
              ExtKit.findAction
90
              ExtKit.findAction
90
          ),
91
          ),
91
          new MultiKeyBinding(
92
          new MultiKeyBinding(
92
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK),
93
              KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK),
93
              ExtKit.replaceAction
94
              ExtKit.replaceAction
94
          ),
95
          ),
95
          new MultiKeyBinding(
96
          new MultiKeyBinding(
Lines 109-119 Link Here
109
              ExtKit.escapeAction
110
              ExtKit.escapeAction
110
          ),
111
          ),
111
          new MultiKeyBinding(
112
          new MultiKeyBinding(
112
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, InputEvent.CTRL_MASK),
113
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK),
113
              ExtKit.matchBraceAction
114
              ExtKit.matchBraceAction
114
          ),
115
          ),
115
          new MultiKeyBinding(
116
          new MultiKeyBinding(
116
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
117
              KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK | InputEvent.SHIFT_MASK),
117
              ExtKit.selectionMatchBraceAction
118
              ExtKit.selectionMatchBraceAction
118
          ),
119
          ),
119
          new MultiKeyBinding(
120
          new MultiKeyBinding(
Lines 121-128 Link Here
121
              ExtKit.showPopupMenuAction
122
              ExtKit.showPopupMenuAction
122
          ),
123
          ),
123
          /*      new MultiKeyBinding(
124
          /*      new MultiKeyBinding(
124
                    KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK),
125
                    KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
125
          //          KeyStroke.getKeyStroke(KeyEvent.VK_BRACELEFT, InputEvent.CTRL_MASK),
126
          //          KeyStroke.getKeyStroke(KeyEvent.VK_BRACELEFT, MENU_MASK),
126
                    ExtKit.braceCodeSelectAction
127
                    ExtKit.braceCodeSelectAction
127
                ),
128
                ),
128
          */
129
          */
(-)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" // NOI18N
165
                       "macro-debug-var" // NOI18N
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-143 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
                   new MultiKeyBinding(
145
                   new MultiKeyBinding(
Lines 146-164 Link Here
146
                   ),
148
                   ),
147
                   new MultiKeyBinding(
149
                   new MultiKeyBinding(
148
                       KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
150
                       KeyStroke.getKeyStroke(KeyEvent.VK_SPACE,
149
                           InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
151
                           mask | InputEvent.SHIFT_MASK),
150
                       JavaKit.javaDocShowAction
152
                       JavaKit.javaDocShowAction
151
                   ),
153
                   ),
152
                   
154
                   
153
                   new MultiKeyBinding(
155
                   new MultiKeyBinding(
154
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
156
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
155
                           InputEvent.CTRL_MASK | InputEvent.ALT_MASK),
157
                           mask | InputEvent.ALT_MASK),
156
                       JavaKit.selectNextElementAction
158
                       JavaKit.selectNextElementAction
157
                   ),
159
                   ),
158
                   
160
                   
159
                   new MultiKeyBinding(
161
                   new MultiKeyBinding(
160
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
162
                       KeyStroke.getKeyStroke(KeyEvent.VK_A,
161
                           InputEvent.CTRL_MASK | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
163
                           mask | InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
162
                       JavaKit.selectPreviousElementAction
164
                       JavaKit.selectPreviousElementAction
163
                   )
165
                   )
164
                   
166
                   
(-)editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultGlobalKeyBindings.xml (-45 / +46 lines)
Lines 13-53 Link Here
13
    <bind actionName="caret-backward" key="LEFT"/>
13
    <bind actionName="caret-backward" key="LEFT"/>
14
    <bind actionName="selection-page-up" key="S-PAGE_UP"/>
14
    <bind actionName="selection-page-up" key="S-PAGE_UP"/>
15
    <bind actionName="caret-end-word" key="A-U$E"/>
15
    <bind actionName="caret-end-word" key="A-U$E"/>
16
    <bind actionName="caret-previous-word" key="C-LEFT"/>
16
    <bind actionName="caret-previous-word" key="S-LEFT"/>
17
    <bind actionName="adjust-window-bottom" key="A-U$B"/>
17
    <bind actionName="adjust-window-bottom" key="A-U$B"/>
18
    <bind actionName="caret-forward" key="RIGHT"/>
18
    <bind actionName="caret-forward" key="RIGHT"/>
19
    <bind actionName="selection-begin" key="CS-HOME"/>
19
    <bind actionName="selection-begin" key="DS-HOME"/>
20
    <bind actionName="undo" key="C-Z"/>
20
    <bind actionName="undo" key="D-Z"/>
21
    <bind actionName="scroll-down" key="C-UP"/>
21
    <bind actionName="scroll-down" key="D-UP"/>
22
    <bind actionName="redo" key="C-Y"/>
22
    <bind actionName="redo" key="D-Y"/>
23
    <bind actionName="cut-to-clipboard" key="C-X"/>
23
    <bind actionName="cut-to-clipboard" key="D-X"/>
24
    <bind actionName="find-previous" key="S-F3"/>
24
    <bind actionName="find-previous" key="S-F3"/>
25
    <bind actionName="remove-word" key="C-W"/>
25
    <bind actionName="remove-word" key="D-W"/>
26
    <bind actionName="paste-from-clipboard" key="C-V"/>
26
    <bind actionName="paste-from-clipboard" key="D-V"/>
27
    <bind actionName="remove-line-begin" key="C-U"/>
27
    <bind actionName="remove-line-begin" key="D-U"/>
28
    <bind actionName="shift-line-right" key="C-T"/>
28
    <bind actionName="shift-line-right" key="D-T"/>
29
    <bind actionName="page-up" key="PAGE_UP"/>
29
    <bind actionName="page-up" key="PAGE_UP"/>
30
    <bind actionName="caret-next-word" key="C-RIGHT"/>
30
    <bind actionName="caret-next-word" key="D-RIGHT"/>
31
    <bind actionName="caret-backward" key="KP_LEFT"/>
31
    <bind actionName="caret-backward" key="KP_LEFT"/>
32
    <bind actionName="select-next-parameter" key="C-M"/>
32
    <bind actionName="select-next-parameter" key="D-M"/>
33
    <bind actionName="word-match-next" key="C-L"/>
33
    <bind actionName="word-match-next" key="D-L"/>
34
    <bind actionName="word-match-prev" key="C-K"/>
34
    <bind actionName="word-match-prev" key="D-K"/>
35
    <bind actionName="cut-to-clipboard" key="S-DELETE"/>
35
    <bind actionName="cut-to-clipboard" key="S-DELETE"/>
36
    <bind actionName="selection-down" key="S-DOWN"/>
36
    <bind actionName="selection-down" key="S-DOWN"/>
37
    <bind actionName="remove-line" key="C-E"/>
37
    <bind actionName="remove-line" key="D-E"/>
38
    <bind actionName="shift-line-left" key="C-D"/>
38
    <bind actionName="shift-line-left" key="D-D"/>
39
    <bind actionName="copy-to-clipboard" key="C-C"/>
39
    <bind actionName="copy-to-clipboard" key="D-C"/>
40
    <bind actionName="select-all" key="C-A"/>
40
    <bind actionName="select-all" key="D-A"/>
41
    <bind actionName="jump-list-next" key="A-L"/>
41
    <bind actionName="jump-list-next" key="A-L"/>
42
    <bind actionName="copy-to-clipboard" key="C-INSERT"/>
42
    <bind actionName="copy-to-clipboard" key="D-INSERT"/>
43
    <bind actionName="jump-list-prev" key="A-K"/>
43
    <bind actionName="jump-list-prev" key="A-K"/>
44
    <bind actionName="select-identifier" key="A-J"/>
44
    <bind actionName="select-identifier" key="A-J"/>
45
    <bind actionName="delete-previous" key="BACK_SPACE"/>
45
    <bind actionName="delete-previous" key="BACK_SPACE"/>
46
    <bind actionName="selection-page-down" key="S-PAGE_DOWN"/>
46
    <bind actionName="selection-page-down" key="S-PAGE_DOWN"/>
47
    <bind actionName="selection-end-line" key="S-END"/>
47
    <bind actionName="selection-end-line" key="S-END"/>
48
    <bind actionName="adjust-caret-top" key="AS-T"/>
48
    <bind actionName="adjust-caret-top" key="AS-T"/>
49
    <bind actionName="caret-end" key="C-END"/>
49
    <bind actionName="caret-end" key="D-END"/>
50
    <bind actionName="find-next" key="F3"/>
50
    <bind actionName="find-next" key="F3"/>
51
    <bind actionName="find-next" key="M-G"/> <!-- macintosh -->
51
    <bind actionName="bookmark-next" key="F2"/>
52
    <bind actionName="bookmark-next" key="F2"/>
52
    <bind actionName="adjust-caret-center" key="AS-M"/>
53
    <bind actionName="adjust-caret-center" key="AS-M"/>
53
    <bind actionName="selection-forward" key="S-RIGHT"/>
54
    <bind actionName="selection-forward" key="S-RIGHT"/>
Lines 58-86 Link Here
58
    <bind actionName="abbrev-reset" key="S-SPACE"/>
59
    <bind actionName="abbrev-reset" key="S-SPACE"/>
59
    <bind actionName="selection-backward" key="S-LEFT"/>
60
    <bind actionName="selection-backward" key="S-LEFT"/>
60
    <bind actionName="insert-tab" key="TAB"/>
61
    <bind actionName="insert-tab" key="TAB"/>
61
    <bind actionName="format" key="CS-F"/>
62
    <bind actionName="format" key="DS-F"/>
62
    <bind actionName="delete-next" key="DELETE"/>
63
    <bind actionName="delete-next" key="DELETE"/>
63
    <bind actionName="caret-begin-line" key="HOME"/>
64
    <bind actionName="caret-begin-line" key="HOME"/>
64
    <bind actionName="selection-up" key="S-UP"/>
65
    <bind actionName="selection-up" key="S-UP"/>
65
    <bind actionName="selection-previous-word" key="CS-LEFT"/>
66
    <bind actionName="selection-previous-word" key="DS-LEFT"/>
66
    <bind actionName="caret-begin" key="C-HOME"/>
67
    <bind actionName="caret-begin" key="D-HOME"/>
67
    <bind actionName="selection-next-word" key="CS-RIGHT"/>
68
    <bind actionName="selection-next-word" key="DS-RIGHT"/>
68
    <bind actionName="caret-forward" key="KP_RIGHT"/>
69
    <bind actionName="caret-forward" key="KP_RIGHT"/>
69
    <bind actionName="default-typed" key="NULL"/>
70
    <bind actionName="default-typed" key="NULL"/>
70
    <bind actionName="find-selection" key="C-F3"/>
71
    <bind actionName="find-selection" key="D-F3"/>
71
    <bind actionName="bookmark-toggle" key="C-F2"/>
72
    <bind actionName="bookmark-toggle" key="D-F2"/>
72
    <bind actionName="paste-from-clipboard" key="S-INSERT"/>
73
    <bind actionName="paste-from-clipboard" key="S-INSERT"/>
73
    <bind actionName="start-macro-recording" key="C-J$S"/>
74
    <bind actionName="start-macro-recording" key="D-J$S"/>
74
    <bind actionName="caret-up" key="KP_UP"/>
75
    <bind actionName="caret-up" key="KP_UP"/>
75
    <bind actionName="caret-down" key="DOWN"/>
76
    <bind actionName="caret-down" key="DOWN"/>
76
    <bind actionName="insert-break" key="ENTER"/>
77
    <bind actionName="insert-break" key="ENTER"/>
77
    <bind actionName="caret-up" key="UP"/>
78
    <bind actionName="caret-up" key="UP"/>
78
    <bind actionName="stop-macro-recording" key="C-J$E"/>
79
    <bind actionName="stop-macro-recording" key="D-J$E"/>
79
    <bind actionName="scroll-up" key="C-DOWN"/>
80
    <bind actionName="scroll-up" key="D-DOWN"/>
80
    <bind actionName="caret-end-line" key="END"/>
81
    <bind actionName="caret-end-line" key="END"/>
81
    <bind actionName="page-down" key="PAGE_DOWN"/>
82
    <bind actionName="page-down" key="PAGE_DOWN"/>
82
    <bind actionName="delete-previous" key="S-BACK_SPACE"/>
83
    <bind actionName="delete-previous" key="S-BACK_SPACE"/>
83
    <bind actionName="selection-end" key="CS-END"/>
84
    <bind actionName="selection-end" key="DS-END"/>
84
    <bind actionName="toggle-typing-mode" key="INSERT"/>
85
    <bind actionName="toggle-typing-mode" key="INSERT"/>
85
    <bind actionName="caret-down" key="KP_DOWN"/>
86
    <bind actionName="caret-down" key="KP_DOWN"/>
86
    <bind actionName="to-upper-case" key="A-U$U"/>
87
    <bind actionName="to-upper-case" key="A-U$U"/>
Lines 89-113 Link Here
89
    <bind actionName="selection-begin-line" key="S-HOME"/>
90
    <bind actionName="selection-begin-line" key="S-HOME"/>
90
    <bind actionName="remove-tab" key="S-TAB"/>
91
    <bind actionName="remove-tab" key="S-TAB"/>
91
    <bind actionName="completion-show" key="C-SPACE"/>
92
    <bind actionName="completion-show" key="C-SPACE"/>
92
    <bind actionName="completion-show" key="C-BACK_SLASH"/>
93
    <bind actionName="completion-show" key="D-BACK_SLASH"/>
93
    <bind actionName="escape" key="ESCAPE"/>
94
    <bind actionName="escape" key="ESCAPE"/>
94
    <bind actionName="find" key="C-F"/>
95
    <bind actionName="find" key="D-F"/>
95
    <bind actionName="goto" key="C-G"/>
96
    <bind actionName="goto" key="C-G"/>
96
    <bind actionName="match-brace" key="C-OPEN_BRACKET"/>
97
    <bind actionName="match-brace" key="D-OPEN_BRACKET"/>
97
    <bind actionName="replace" key="C-H"/>
98
    <bind actionName="replace" key="C-H"/>
98
    <bind actionName="selection-match-brace" key="CS-B"/>
99
    <bind actionName="selection-match-brace" key="DS-B"/>
99
    <bind actionName="shift-insert-break" key="S-ENTER"/>
100
    <bind actionName="shift-insert-break" key="S-ENTER"/>
100
    <bind actionName="show-popup-menu" key="S-F10"/>
101
    <bind actionName="show-popup-menu" key="S-F10"/>
101
    <bind actionName="annotations-cycling" key="CS-C"/>
102
    <bind actionName="annotations-cycling" key="DS-C"/>
102
    <bind actionName="collapse-all-folds" key="CS-SUBTRACT"/>
103
    <bind actionName="collapse-all-folds" key="DS-SUBTRACT"/>
103
    <bind actionName="expand-all-folds" key="CS-ADD"/>
104
    <bind actionName="expand-all-folds" key="DS-ADD"/>
104
    <bind actionName="collapse-fold" key="C-SUBTRACT"/>
105
    <bind actionName="collapse-fold" key="D-SUBTRACT"/>
105
    <bind actionName="expand-fold" key="C-ADD"/>
106
    <bind actionName="expand-fold" key="D-ADD"/>
106
    <bind actionName="collapse-all-folds" key="CS-MINUS"/>
107
    <bind actionName="collapse-all-folds" key="DS-MINUS"/>
107
    <bind actionName="expand-all-folds" key="CS-EQUALS"/>
108
    <bind actionName="expand-all-folds" key="DS-EQUALS"/>
108
    <bind actionName="expand-all-folds" key="CS-PLUS"/>
109
    <bind actionName="expand-all-folds" key="DS-PLUS"/>
109
    <bind actionName="collapse-fold" key="C-MINUS"/>
110
    <bind actionName="collapse-fold" key="D-MINUS"/>
110
    <bind actionName="expand-fold" key="C-EQUALS"/>
111
    <bind actionName="expand-fold" key="D-EQUALS"/>
111
    <bind actionName="expand-fold" key="C-PLUS"/>
112
    <bind actionName="expand-fold" key="D-PLUS"/>
112
    
113
    
113
</bindings>
114
</bindings>
(-)editor/src/org/netbeans/modules/editor/resources/XMLs/DefaultKeyBindings.xml (-6 / +6 lines)
Lines 6-20 Link Here
6
    <bind actionName="fast-import" key="AS-I"/>
6
    <bind actionName="fast-import" key="AS-I"/>
7
    <bind actionName="fix-imports" key="AS-F"/>
7
    <bind actionName="fix-imports" key="AS-F"/>
8
    <!-- <bind actionName="try-catch" key="CA-S"/> -->
8
    <!-- <bind actionName="try-catch" key="CA-S"/> -->
9
    <bind actionName="goto-super-implementation" key="C-B"/>
9
    <bind actionName="goto-super-implementation" key="D-B"/>
10
    <bind actionName="goto-declaration" key="A-G"/>    
10
    <bind actionName="goto-declaration" key="A-G"/>    
11
    <bind actionName="comment" key="CS-T"/>
11
    <bind actionName="comment" key="DS-T"/>
12
    <bind actionName="goto-help" key="A-F1"/>
12
    <bind actionName="goto-help" key="A-F1"/>
13
    <bind actionName="make-is" key="A-U$I"/>
13
    <bind actionName="make-is" key="A-U$I"/>
14
    <bind actionName="make-getter" key="A-U$G"/>
14
    <bind actionName="make-getter" key="A-U$G"/>
15
    <bind actionName="macro-debug-var" key="C-J$D"/>
15
    <bind actionName="macro-debug-var" key="D-J$D"/>
16
    <bind actionName="uncomment" key="CS-D"/>
16
    <bind actionName="uncomment" key="DS-D"/>
17
    <bind actionName="make-setter" key="A-U$S"/>
17
    <bind actionName="make-setter" key="A-U$S"/>
18
    <bind actionName="select-next-element" key="CA-A"/>
18
    <bind actionName="select-next-element" key="DA-A"/>
19
    <bind actionName="select-previous-element" key="CAS-A"/>
19
    <bind actionName="select-previous-element" key="DAS-A"/>
20
</bindings>
20
</bindings>
(-)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/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 145-151 Link Here
145
  </folder>
145
  </folder>
146
146
147
  <folder name="Shortcuts">
147
  <folder name="Shortcuts">
148
    <file name="C-I.shadow">
148
    <file name="D-I.shadow">
149
        <attr name="originalFile" stringvalue="Actions/Tools/org-netbeans-modules-java-tools-OverrideAction.instance"/>
149
        <attr name="originalFile" stringvalue="Actions/Tools/org-netbeans-modules-java-tools-OverrideAction.instance"/>
150
    </file>
150
    </file>
151
  </folder>
151
  </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 490-520 Link Here
490
    
490
    
491
    <folder name="Shortcuts">
491
    <folder name="Shortcuts">
492
    
492
    
493
        <file name="CS-N.shadow">
493
        <file name="DS-N.shadow">
494
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewProject.instance"/>
494
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewProject.instance"/>
495
	</file>
495
	</file>
496
        
496
        
497
        <file name="C-N.shadow">
497
        <file name="D-N.shadow">
498
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewFile.instance"/>
498
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-NewFile.instance"/>
499
	</file>
499
	</file>
500
        
500
        
501
        <file name="CS-O.shadow">
501
        <file name="DS-O.shadow">
502
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-OpenProject.instance"/>
502
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-OpenProject.instance"/>
503
	</file>
503
	</file>
504
    
504
    
505
        <file name="C-1.shadow">
505
        <file name="D-1.shadow">
506
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-logical-tab-action.instance"/>
506
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-logical-tab-action.instance"/>
507
        </file>
507
        </file>
508
508
509
        <file name="C-2.shadow">
509
        <file name="D-2.shadow">
510
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-physical-tab-action.instance"/>
510
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-physical-tab-action.instance"/>
511
	</file>
511
	</file>
512
512
513
        <file name="CS-1.shadow">
513
        <file name="DS-1.shadow">
514
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInProjects.instance"/>
514
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInProjects.instance"/>
515
	</file>
515
	</file>
516
        
516
        
517
        <file name="CS-2.shadow">
517
        <file name="DS-2.shadow">
518
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInFiles.instance"/>
518
	    <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-SelectInFiles.instance"/>
519
	</file>
519
	</file>
520
        
520
        
Lines 538-552 Link Here
538
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RunSingle.instance"/>
538
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-RunSingle.instance"/>
539
	</file>
539
	</file>
540
        
540
        
541
        <file name="CS-F5.shadow">
541
        <file name="DS-F5.shadow">
542
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugSingle.instance"/>
542
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugSingle.instance"/>
543
	</file>
543
	</file>
544
        
544
        
545
        <file name="C-F6.shadow">
545
        <file name="D-F6.shadow">
546
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-TestSingle.instance"/>
546
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-TestSingle.instance"/>
547
	</file>
547
	</file>
548
        
548
        
549
        <file name="CS-F6.shadow">
549
        <file name="DS-F6.shadow">
550
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugTestSingle.instance"/>
550
            <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-DebugTestSingle.instance"/>
551
	</file>
551
	</file>
552
        
552
        
(-)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