KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > editor > SettingsDefaults


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.editor;
21
22 import java.awt.Color JavaDoc;
23 import java.awt.Font JavaDoc;
24 import java.awt.Insets JavaDoc;
25 import java.awt.Dimension JavaDoc;
26 import java.awt.event.KeyEvent JavaDoc;
27 import java.awt.event.InputEvent JavaDoc;
28 import javax.swing.KeyStroke JavaDoc;
29 import javax.swing.UIManager JavaDoc;
30 import java.util.Map JavaDoc;
31 import java.util.HashMap JavaDoc;
32
33 /**
34 * Default values for the settings. They are used
35 * by <tt>BaseSettingsInitializer</tt> to initialize
36 * the settings with the default values. They can be also used
37 * for substitution if the value of the particular setting
38 * is unacceptable.
39 *
40 * @author Miloslav Metelka
41 * @version 1.00
42 */

43
44 public class SettingsDefaults {
45
46     private static final Integer JavaDoc INTEGER_MAX_VALUE = new Integer JavaDoc(Integer.MAX_VALUE);
47
48     // Caret color
49
public static final Color JavaDoc defaultCaretColor = Color.black;
50
51     // Empty coloring - it doesn't change font or colors
52
public static final Coloring emptyColoring = new Coloring(null, null, null);
53
54     // Default coloring
55
private static int defaultFontSize; // Fix of #33249
56
static {
57         Integer JavaDoc customFontSize = (Integer JavaDoc)UIManager.get("customFontSize"); // NOI18N
58
if (customFontSize != null) {
59             defaultFontSize = customFontSize.intValue();
60         } else {
61             Font JavaDoc systemDefaultFont = UIManager.getFont("TextField.font"); // NOI18N
62
defaultFontSize = (systemDefaultFont != null)
63                 ? systemDefaultFont.getSize()
64                 : 12;
65         }
66     }
67
68     public static final Font JavaDoc defaultFont = new Font JavaDoc("Monospaced", Font.PLAIN, defaultFontSize); // NOI18N
69
public static final Color JavaDoc defaultForeColor = Color.black;
70     public static final Color JavaDoc defaultBackColor = Color.white;
71     public static final Coloring defaultColoring
72     = new Coloring(defaultFont, defaultForeColor, defaultBackColor);
73     // line number coloring
74
public static final Color JavaDoc defaultLineNumberForeColor = Color.BLACK;
75     public static final Color JavaDoc defaultLineNumberBackColor = new Color JavaDoc(233, 232, 226);
76     public static final Coloring defaultLineNumberColoring
77     = new Coloring(null, defaultLineNumberForeColor, defaultLineNumberBackColor);
78     // gutter line
79
public static final Color JavaDoc defaultGutterLine = new Color JavaDoc(184, 184, 184);
80     // caret selection coloring
81
public static final Color JavaDoc defaultSelectionForeColor = Color.white;
82     public static final Color JavaDoc defaultSelectionBackColor = new Color JavaDoc(180, 180, 180);
83     public static final Coloring defaultSelectionColoring
84     = new Coloring(null, defaultSelectionForeColor, defaultSelectionBackColor);
85     // Highlight search coloring
86
public static final Color JavaDoc defaultHighlightSearchForeColor = Color.black;
87     public static final Color JavaDoc defaultHighlightSearchBackColor = new Color JavaDoc(246, 248, 139);
88     public static final Coloring defaultHighlightSearchColoring
89     = new Coloring(null, defaultHighlightSearchForeColor, defaultHighlightSearchBackColor);
90     // Incremental search coloring
91
public static final Color JavaDoc defaultIncSearchForeColor = Color.black;
92     public static final Color JavaDoc defaultIncSearchBackColor = new Color JavaDoc(255, 153, 0);
93     public static final Coloring defaultIncSearchColoring
94     = new Coloring(null, defaultIncSearchForeColor, defaultIncSearchBackColor);
95     // Block search coloring
96
public static final Color JavaDoc defaultBlockSearchForeColor = Color.black;
97     public static final Color JavaDoc defaultBlockSearchBackColor = new Color JavaDoc(224,232,241);
98     public static final Coloring defaultblockSearchColoring
99     = new Coloring(null, defaultBlockSearchForeColor, defaultBlockSearchBackColor);
100
101     // Guarded blocks coloring
102
public static final Color JavaDoc defaultGuardedForeColor = null;
103     public static final Color JavaDoc defaultGuardedBackColor = new Color JavaDoc(225, 236, 247);
104     public static final Coloring defaultGuardedColoring
105     = new Coloring(null, defaultGuardedForeColor, defaultGuardedBackColor);
106     
107     // code folding coloring
108
public static final Color JavaDoc defaultCodeFoldingForeColor = new Color JavaDoc(102, 102, 102);
109     public static final Coloring defaultCodeFoldingColoring
110     = new Coloring(null, defaultCodeFoldingForeColor, null);
111     
112     // code folding bar coloring
113
public static final Color JavaDoc defaultCodeFoldingBarForeColor = new Color JavaDoc(102, 102, 102);
114     public static final Color JavaDoc defaultCodeFoldingBarBackColor = Color.WHITE;
115     public static final Coloring defaultCodeFoldingBarColoring
116     = new Coloring(null, defaultCodeFoldingBarForeColor, null);
117
118     public static final Color JavaDoc defaultStatusBarForeColor =
119             UIManager.getColor("ScrollPane.foreground"); //NOI18N
120
public static final Color JavaDoc defaultStatusBarBackColor =
121             UIManager.getColor("ScrollPane.background"); // NOI18N
122
public static final Coloring defaultStatusBarColoring
123     = new Coloring(defaultFont, defaultStatusBarForeColor, defaultStatusBarBackColor);
124
125     public static final Color JavaDoc defaultStatusBarBoldForeColor = Color.white;
126     public static final Color JavaDoc defaultStatusBarBoldBackColor = Color.red;
127     public static final Coloring defaultStatusBarBoldColoring
128     = new Coloring(defaultFont, defaultStatusBarBoldForeColor, defaultStatusBarBoldBackColor);
129
130     public static final Integer JavaDoc defaultCaretBlinkRate = new Integer JavaDoc(300);
131     public static final Integer JavaDoc defaultTabSize = new Integer JavaDoc(8);
132     public static final Integer JavaDoc defaultSpacesPerTab = new Integer JavaDoc(4);
133     public static final Integer JavaDoc defaultShiftWidth = new Integer JavaDoc(4); // usually
134
// not used as there's a Evaluator for shift width
135

136     public static final Integer JavaDoc defaultStatusBarCaretDelay = new Integer JavaDoc(200);
137
138     public static final Color JavaDoc defaultTextLimitLineColor = new Color JavaDoc(255, 235, 235);
139     public static final Integer JavaDoc defaultTextLimitWidth = new Integer JavaDoc(80);
140
141     public static final Acceptor defaultIdentifierAcceptor = AcceptorFactory.LETTER_DIGIT;
142     public static final Acceptor defaultWhitespaceAcceptor = AcceptorFactory.WHITESPACE;
143
144     public static final Float JavaDoc defaultLineHeightCorrection = new Float JavaDoc(1.0f);
145
146     public static final Integer JavaDoc defaultTextLeftMarginWidth = new Integer JavaDoc(2);
147     public static final Insets JavaDoc defaultMargin = new Insets JavaDoc(0, 0, 0, 0);
148     public static final Insets JavaDoc defaultScrollJumpInsets = new Insets JavaDoc(-5, -10, -5, -30);
149     public static final Insets JavaDoc defaultScrollFindInsets = new Insets JavaDoc(-10, -10, -10, -10);
150     public static final Dimension JavaDoc defaultComponentSizeIncrement = new Dimension JavaDoc(-5, -30);
151
152     public static final Integer JavaDoc defaultReadBufferSize = new Integer JavaDoc(16384);
153     public static final Integer JavaDoc defaultWriteBufferSize = new Integer JavaDoc(16384);
154     public static final Integer JavaDoc defaultReadMarkDistance = new Integer JavaDoc(180);
155     public static final Integer JavaDoc defaultMarkDistance = new Integer JavaDoc(100);
156     public static final Integer JavaDoc defaultMaxMarkDistance = new Integer JavaDoc(150);
157     public static final Integer JavaDoc defaultMinMarkDistance = new Integer JavaDoc(50);
158     public static final Integer JavaDoc defaultSyntaxUpdateBatchSize
159     = new Integer JavaDoc(defaultMarkDistance.intValue() * 7);
160     public static final Integer JavaDoc defaultLineBatchSize = new Integer JavaDoc(2);
161
162     public static final Boolean JavaDoc defaultExpandTabs = Boolean.TRUE;
163
164     public static final String JavaDoc defaultCaretTypeInsertMode = BaseCaret.LINE_CARET;
165     public static final String JavaDoc defaultCaretTypeOverwriteMode = BaseCaret.BLOCK_CARET;
166     public static final Color JavaDoc defaultCaretColorInsertMode = Color.black;
167     public static final Color JavaDoc defaultCaretColorOvwerwriteMode = Color.black;
168     public static final Boolean JavaDoc defaultCaretItalicInsertMode = Boolean.FALSE;
169     public static final Boolean JavaDoc defaultCaretItalicOverwriteMode = Boolean.FALSE;
170     public static final Acceptor defaultAbbrevExpandAcceptor = AcceptorFactory.WHITESPACE;
171     public static final Acceptor defaultAbbrevAddTypedCharAcceptor = AcceptorFactory.NL;
172     public static final Acceptor defaultAbbrevResetAcceptor = AcceptorFactory.NON_JAVA_IDENTIFIER;
173     public static final Map JavaDoc defaultAbbrevMap = new HashMap JavaDoc();
174
175     public static final Map JavaDoc defaultMacroMap = new HashMap JavaDoc();
176     
177     public static final Boolean JavaDoc defaultStatusBarVisible = Boolean.TRUE;
178
179     public static final Boolean JavaDoc defaultLineNumberVisible = Boolean.FALSE;
180     public static final Boolean JavaDoc defaultPrintLineNumberVisible = Boolean.TRUE;
181     public static final Boolean JavaDoc defaultTextLimitLineVisible = Boolean.TRUE;
182     public static final Boolean JavaDoc defaultHomeKeyColumnOne = Boolean.FALSE;
183     public static final Boolean JavaDoc defaultWordMoveNewlineStop = Boolean.TRUE;
184     public static final Boolean JavaDoc defaultInputMethodsEnabled = Boolean.TRUE;
185     public static final Boolean JavaDoc defaultFindHighlightSearch = Boolean.TRUE;
186     public static final Boolean JavaDoc defaultFindIncSearch = Boolean.TRUE;
187     public static final Boolean JavaDoc defaultFindBackwardSearch = Boolean.FALSE;
188     public static final Boolean JavaDoc defaultFindWrapSearch = Boolean.TRUE;
189     public static final Boolean JavaDoc defaultFindMatchCase = Boolean.FALSE;
190     public static final Boolean JavaDoc defaultFindWholeWords = Boolean.FALSE;
191     public static final Boolean JavaDoc defaultFindRegExp = Boolean.FALSE;
192     public static final Integer JavaDoc defaultFindHistorySize = new Integer JavaDoc(30);
193     public static final Integer JavaDoc defaultWordMatchSearchLen = INTEGER_MAX_VALUE;
194     public static final Boolean JavaDoc defaultWordMatchWrapSearch = Boolean.TRUE;
195     public static final Boolean JavaDoc defaultWordMatchMatchOneChar = Boolean.TRUE;
196     public static final Boolean JavaDoc defaultWordMatchMatchCase = Boolean.FALSE;
197     public static final Boolean JavaDoc defaultWordMatchSmartCase = Boolean.FALSE;
198     public static final Boolean JavaDoc defaultCodeFoldingEnable = Boolean.FALSE;
199     
200     public static final String JavaDoc[] defaultColoringNames
201     = new String JavaDoc[] {
202           SettingsNames.DEFAULT_COLORING,
203           SettingsNames.LINE_NUMBER_COLORING,
204           SettingsNames.GUARDED_COLORING,
205           SettingsNames.CODE_FOLDING_COLORING,
206           SettingsNames.CODE_FOLDING_BAR_COLORING,
207           SettingsNames.SELECTION_COLORING,
208           SettingsNames.HIGHLIGHT_SEARCH_COLORING,
209           SettingsNames.INC_SEARCH_COLORING,
210           SettingsNames.BLOCK_SEARCH_COLORING,
211           SettingsNames.STATUS_BAR_COLORING,
212           SettingsNames.STATUS_BAR_BOLD_COLORING
213       };
214
215     
216     private static final int FIND_NEXT_KEY =
217         System.getProperty("mrj.version") == null ?
218         KeyEvent.VK_F3 : KeyEvent.VK_G;
219         
220     private static final int FIND_NEXT_MASK =
221         System.getProperty("mrj.version") == null ?
222         0 : KeyEvent.META_DOWN_MASK;
223
224     //#26854 - use Command, not Ctrl, on mac
225
private static final int MENU_MASK = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
226     
227     //Default behavior on mac is that alt+arrows is word jumps
228
private static final int WORD_SELECT_MASK = System.getProperty("mrj.version") == null ?
229         InputEvent.CTRL_DOWN_MASK : InputEvent.ALT_DOWN_MASK;
230     
231     private static final int ALT_MASK = System.getProperty("mrj.version") == null ?
232         InputEvent.ALT_DOWN_MASK : InputEvent.CTRL_DOWN_MASK;
233         
234 // public static MultiKeyBinding[] defaultKeyBindings
235
// = new MultiKeyBinding[] {
236
// new MultiKeyBinding( //1
237
// KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
238
// BaseKit.insertBreakAction
239
// ),
240
// new MultiKeyBinding( //2
241
// KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, MENU_MASK),
242
// BaseKit.splitLineAction
243
// ),
244
// new MultiKeyBinding( //3
245
// KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK),
246
// BaseKit.startNewLineAction
247
// ),
248
//
249
// // start-new-line-action cannot be registered here as there
250
// // is already another action registered for Shift+enter in
251
// // the ext-kit. The code is added directly there
252
// // new MultiKeyBinding(
253
// // KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK),
254
// // BaseKit.startNewLineAction
255
// // ),
256
// new MultiKeyBinding( //4
257
// KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
258
// BaseKit.insertTabAction
259
// ),
260
// new MultiKeyBinding( //5
261
// KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK),
262
// BaseKit.removeTabAction
263
// ),
264
// new MultiKeyBinding( //6
265
// KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0),
266
// BaseKit.deletePrevCharAction
267
// ),
268
// new MultiKeyBinding( //7
269
// KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, InputEvent.SHIFT_MASK),
270
// BaseKit.deletePrevCharAction
271
// ),
272
///* new MultiKeyBinding(
273
// KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK | InputEvent.SHIFT_MASK),
274
// BaseKit.deletePrevCharAction
275
// ),
276
//*/ new MultiKeyBinding( //8
277
// KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
278
// BaseKit.deleteNextCharAction
279
// ),
280
// new MultiKeyBinding( //9
281
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0),
282
// BaseKit.forwardAction
283
// ),
284
// new MultiKeyBinding( //10
285
// KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, 0), // keypad right
286
// BaseKit.forwardAction
287
// ),
288
// new MultiKeyBinding( //11
289
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK),
290
// BaseKit.selectionForwardAction
291
// ),
292
// new MultiKeyBinding( //12
293
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, WORD_SELECT_MASK),
294
// BaseKit.nextWordAction
295
// ),
296
// new MultiKeyBinding( //13
297
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
298
// BaseKit.selectionNextWordAction
299
// ),
300
// new MultiKeyBinding( //14
301
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0),
302
// BaseKit.backwardAction
303
// ),
304
// new MultiKeyBinding( //15
305
// KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, 0), // keypad left
306
// BaseKit.backwardAction
307
// ),
308
// new MultiKeyBinding( //16
309
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK),
310
// BaseKit.selectionBackwardAction
311
// ),
312
// new MultiKeyBinding( //17
313
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, WORD_SELECT_MASK),
314
// BaseKit.previousWordAction
315
// ),
316
// new MultiKeyBinding( //18
317
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | WORD_SELECT_MASK),
318
// BaseKit.selectionPreviousWordAction
319
// ),
320
// new MultiKeyBinding( //19
321
// KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
322
// BaseKit.downAction
323
// ),
324
// new MultiKeyBinding( //20
325
// KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0), // keypad down
326
// BaseKit.downAction
327
// ),
328
// new MultiKeyBinding( //21
329
// KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_MASK),
330
// BaseKit.selectionDownAction
331
// ),
332
// new MultiKeyBinding( //22
333
// KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK),
334
// BaseKit.scrollUpAction
335
// ),
336
// new MultiKeyBinding( //23
337
// KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0),
338
// BaseKit.upAction
339
// ),
340
// new MultiKeyBinding( //24
341
// KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0), // keypad up
342
// BaseKit.upAction
343
// ),
344
// new MultiKeyBinding( //25
345
// KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
346
// BaseKit.selectionUpAction
347
// ),
348
// new MultiKeyBinding( //26
349
// KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK),
350
// BaseKit.scrollDownAction
351
// ),
352
// new MultiKeyBinding( //27
353
// KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
354
// BaseKit.pageDownAction
355
// ),
356
// new MultiKeyBinding( //28
357
// KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.SHIFT_MASK),
358
// BaseKit.selectionPageDownAction
359
// ),
360
// new MultiKeyBinding( //29
361
// KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
362
// BaseKit.pageUpAction
363
// ),
364
// new MultiKeyBinding( //30
365
// KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_MASK),
366
// BaseKit.selectionPageUpAction
367
// ),
368
// new MultiKeyBinding( //31
369
// KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
370
// BaseKit.beginLineAction
371
// ),
372
// new MultiKeyBinding( //32
373
// KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK),
374
// BaseKit.selectionBeginLineAction
375
// ),
376
// new MultiKeyBinding( //33
377
// KeyStroke.getKeyStroke(KeyEvent.VK_HOME, MENU_MASK),
378
// BaseKit.beginAction
379
// ),
380
// new MultiKeyBinding( //34
381
// KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | MENU_MASK),
382
// BaseKit.selectionBeginAction
383
// ),
384
// new MultiKeyBinding( //35
385
// KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
386
// BaseKit.endLineAction
387
// ),
388
// new MultiKeyBinding( //36
389
// KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK),
390
// BaseKit.selectionEndLineAction
391
// ),
392
// new MultiKeyBinding( //37
393
// KeyStroke.getKeyStroke(KeyEvent.VK_END, MENU_MASK),
394
// BaseKit.endAction
395
// ),
396
// new MultiKeyBinding( //38
397
// KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | MENU_MASK),
398
// BaseKit.selectionEndAction
399
// ),
400
//
401
// // clipboard bindings
402
// new MultiKeyBinding( //39
403
// KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK),
404
// BaseKit.copyAction
405
// ),
406
// new MultiKeyBinding( //40
407
// KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, MENU_MASK),
408
// BaseKit.copyAction
409
// ),
410
// new MultiKeyBinding( //41
411
// KeyStroke.getKeyStroke(KeyEvent.VK_COPY, 0),
412
// BaseKit.copyAction
413
// ),
414
// new MultiKeyBinding( //42
415
// KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.SHIFT_MASK),
416
// BaseKit.cutAction
417
// ),
418
// new MultiKeyBinding( //43
419
// KeyStroke.getKeyStroke(KeyEvent.VK_X, MENU_MASK),
420
// BaseKit.cutAction
421
// ),
422
// new MultiKeyBinding( //44
423
// KeyStroke.getKeyStroke(KeyEvent.VK_CUT, 0),
424
// BaseKit.cutAction
425
// ),
426
// new MultiKeyBinding( //45
427
// KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK),
428
// BaseKit.pasteAction
429
// ),
430
// new MultiKeyBinding( //46
431
// KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.SHIFT_MASK),
432
// BaseKit.pasteAction
433
// ),
434
// new MultiKeyBinding( //47
435
// KeyStroke.getKeyStroke(KeyEvent.VK_PASTE, 0),
436
// BaseKit.pasteAction
437
// ),
438
// new MultiKeyBinding( //48
439
// KeyStroke.getKeyStroke(KeyEvent.VK_V, MENU_MASK | InputEvent.SHIFT_MASK),
440
// BaseKit.pasteFormatedAction
441
// ),
442
//
443
// // undo and redo bindings - handled at system level
444
// new MultiKeyBinding( //49
445
// KeyStroke.getKeyStroke(KeyEvent.VK_Z, MENU_MASK),
446
// BaseKit.undoAction
447
// ),
448
// new MultiKeyBinding( //50
449
// KeyStroke.getKeyStroke(KeyEvent.VK_UNDO, 0),
450
// BaseKit.undoAction
451
// ),
452
// new MultiKeyBinding( //51
453
// KeyStroke.getKeyStroke(KeyEvent.VK_Y, MENU_MASK),
454
// BaseKit.redoAction
455
// ),
456
//
457
// // other bindings
458
// new MultiKeyBinding( //52
459
// KeyStroke.getKeyStroke(KeyEvent.VK_A, MENU_MASK),
460
// BaseKit.selectAllAction
461
// ),
462
// new MultiKeyBinding( //53
463
// new KeyStroke[] {
464
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
465
// KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
466
// },
467
// BaseKit.endWordAction
468
// ),
469
// /* #47709
470
// new MultiKeyBinding( //54
471
// KeyStroke.getKeyStroke(KeyEvent.VK_W, MENU_MASK),
472
// BaseKit.removeWordAction
473
// ),
474
// */
475
// new MultiKeyBinding( //55
476
// KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
477
// BaseKit.removeLineBeginAction
478
// ),
479
// new MultiKeyBinding( //56
480
// KeyStroke.getKeyStroke(KeyEvent.VK_E, MENU_MASK),
481
// BaseKit.removeLineAction
482
// ),
483
// new MultiKeyBinding( //57
484
// KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),
485
// BaseKit.toggleTypingModeAction
486
// ),
487
///* new MultiKeyBinding( //58
488
// KeyStroke.getKeyStroke(KeyEvent.VK_F2, MENU_MASK),
489
// BaseKit.toggleBookmarkAction
490
// ),
491
// new MultiKeyBinding( //59
492
// KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0),
493
// BaseKit.gotoNextBookmarkAction
494
// ),
495
// new MultiKeyBinding( //59.5
496
// KeyStroke.getKeyStroke(KeyEvent.VK_F2, KeyEvent.SHIFT_DOWN_MASK),
497
// BaseKit.gotoPreviousBookmarkAction
498
// ),
499
// */
500
// new MultiKeyBinding( //60
501
// KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK),
502
// BaseKit.findNextAction
503
// ),
504
// new MultiKeyBinding( //61
505
// KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.SHIFT_MASK),
506
// BaseKit.findPreviousAction
507
// ),
508
// new MultiKeyBinding( //62
509
// KeyStroke.getKeyStroke(FIND_NEXT_KEY, FIND_NEXT_MASK | InputEvent.CTRL_MASK),
510
// BaseKit.findSelectionAction
511
// ),
512
// new MultiKeyBinding( //63
513
// KeyStroke.getKeyStroke(KeyEvent.VK_H, ALT_MASK | InputEvent.SHIFT_MASK),
514
// BaseKit.toggleHighlightSearchAction
515
// ),
516
// new MultiKeyBinding( //64
517
// KeyStroke.getKeyStroke(KeyEvent.VK_L, MENU_MASK),
518
// BaseKit.wordMatchNextAction
519
// ),
520
// new MultiKeyBinding( //65
521
// KeyStroke.getKeyStroke(KeyEvent.VK_K, MENU_MASK),
522
// BaseKit.wordMatchPrevAction
523
// ),
524
// new MultiKeyBinding( //66
525
// KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_MASK),
526
// BaseKit.shiftLineRightAction
527
// ),
528
// new MultiKeyBinding( //67
529
// KeyStroke.getKeyStroke(KeyEvent.VK_D, MENU_MASK),
530
// BaseKit.shiftLineLeftAction
531
// ),
532
// new MultiKeyBinding( //68
533
// KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.SHIFT_MASK),
534
// BaseKit.abbrevResetAction
535
// ),
536
// new MultiKeyBinding( //69
537
// KeyStroke.getKeyStroke(KeyEvent.VK_C, MENU_MASK | InputEvent.SHIFT_MASK),
538
// BaseKit.annotationsCyclingAction
539
// ),
540
//
541
// new MultiKeyBinding( //70
542
// new KeyStroke[] {
543
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
544
// KeyStroke.getKeyStroke(KeyEvent.VK_T, 0),
545
// },
546
// BaseKit.adjustWindowTopAction
547
// ),
548
// new MultiKeyBinding( //71
549
// new KeyStroke[] {
550
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
551
// KeyStroke.getKeyStroke(KeyEvent.VK_M, 0),
552
// },
553
// BaseKit.adjustWindowCenterAction
554
// ),
555
// new MultiKeyBinding( //72
556
// new KeyStroke[] {
557
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
558
// KeyStroke.getKeyStroke(KeyEvent.VK_B, 0),
559
// },
560
// BaseKit.adjustWindowBottomAction
561
// ),
562
//
563
// new MultiKeyBinding( //73
564
// KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.SHIFT_MASK | ALT_MASK),
565
// BaseKit.adjustCaretTopAction
566
// ),
567
// new MultiKeyBinding( //74
568
// KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.SHIFT_MASK | ALT_MASK),
569
// BaseKit.adjustCaretCenterAction
570
// ),
571
// new MultiKeyBinding( //75
572
// KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.SHIFT_MASK | ALT_MASK),
573
// BaseKit.adjustCaretBottomAction
574
// ),
575
//
576
// new MultiKeyBinding( //76
577
// KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK | InputEvent.SHIFT_MASK ),
578
// BaseKit.formatAction
579
// ),
580
// new MultiKeyBinding( //77
581
// KeyStroke.getKeyStroke(KeyEvent.VK_J, ALT_MASK),
582
// BaseKit.selectIdentifierAction
583
// ),
584
// new MultiKeyBinding( //78
585
// KeyStroke.getKeyStroke(KeyEvent.VK_K, ALT_MASK),
586
// BaseKit.jumpListPrevAction
587
// ),
588
// new MultiKeyBinding( //79
589
// KeyStroke.getKeyStroke(KeyEvent.VK_L, ALT_MASK),
590
// BaseKit.jumpListNextAction
591
// ),
592
// new MultiKeyBinding( //80
593
// KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.SHIFT_MASK | ALT_MASK),
594
// BaseKit.jumpListPrevComponentAction
595
// ),
596
// new MultiKeyBinding( //81
597
// KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.SHIFT_MASK | ALT_MASK),
598
// BaseKit.jumpListNextComponentAction
599
// ),
600
// new MultiKeyBinding( //82
601
// new KeyStroke[] {
602
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
603
// KeyStroke.getKeyStroke(KeyEvent.VK_U, 0),
604
// },
605
// BaseKit.toUpperCaseAction
606
// ),
607
// new MultiKeyBinding( //83
608
// new KeyStroke[] {
609
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
610
// KeyStroke.getKeyStroke(KeyEvent.VK_L, 0),
611
// },
612
// BaseKit.toLowerCaseAction
613
// ),
614
// new MultiKeyBinding( //84
615
// new KeyStroke[] {
616
// KeyStroke.getKeyStroke(KeyEvent.VK_U, ALT_MASK),
617
// KeyStroke.getKeyStroke(KeyEvent.VK_R, 0),
618
// },
619
// BaseKit.switchCaseAction
620
// ),
621
//
622
// new MultiKeyBinding( //85
623
// KeyStroke.getKeyStroke(KeyEvent.VK_M, MENU_MASK),
624
// BaseKit.selectNextParameterAction
625
// ),
626
//
627
// new MultiKeyBinding( //86
628
// new KeyStroke[] {
629
// KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
630
// KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
631
// },
632
// BaseKit.startMacroRecordingAction
633
// ),
634
//
635
// new MultiKeyBinding( //87
636
// new KeyStroke[] {
637
// KeyStroke.getKeyStroke(KeyEvent.VK_J, MENU_MASK),
638
// KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
639
// },
640
// BaseKit.stopMacroRecordingAction
641
// ),
642
//
643
// new MultiKeyBinding( //88
644
// KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK),
645
// BaseKit.collapseFoldAction
646
// ),
647
//
648
// new MultiKeyBinding( //89
649
// KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK),
650
// BaseKit.expandFoldAction
651
// ),
652
//
653
// new MultiKeyBinding( //90
654
// KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, MENU_MASK | InputEvent.SHIFT_MASK),
655
// BaseKit.collapseAllFoldsAction
656
// ),
657
//
658
// new MultiKeyBinding( //91
659
// KeyStroke.getKeyStroke(KeyEvent.VK_ADD, MENU_MASK | InputEvent.SHIFT_MASK),
660
// BaseKit.expandAllFoldsAction
661
// ),
662
//
663
// new MultiKeyBinding( //92
664
// KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK),
665
// BaseKit.collapseFoldAction
666
// ),
667
//
668
// new MultiKeyBinding( //93
669
// KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK),
670
// BaseKit.expandFoldAction
671
// ),
672
//
673
// new MultiKeyBinding( //94
674
// KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK),
675
// BaseKit.expandFoldAction
676
// ),
677
//
678
// new MultiKeyBinding( //95
679
// KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, MENU_MASK | InputEvent.SHIFT_MASK),
680
// BaseKit.collapseAllFoldsAction
681
// ),
682
//
683
// new MultiKeyBinding( //96
684
// KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, MENU_MASK | InputEvent.SHIFT_MASK),
685
// BaseKit.expandAllFoldsAction
686
// ),
687
//
688
// new MultiKeyBinding( //97
689
// KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, MENU_MASK | InputEvent.SHIFT_MASK),
690
// BaseKit.expandAllFoldsAction
691
// ),
692
//
693
// new MultiKeyBinding( //98
694
// KeyStroke.getKeyStroke(KeyEvent.VK_Q, ALT_MASK | InputEvent.SHIFT_MASK),
695
// "dump-view-hierarchy" // NOI18N
696
// ),
697
// new MultiKeyBinding( //99
698
// KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, MENU_MASK),
699
// BaseKit.removePreviousWordAction
700
// ),
701
// new MultiKeyBinding( //100
702
// KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, MENU_MASK),
703
// BaseKit.removeNextWordAction
704
// )
705
// };
706

707       //#46811 - Install mac specific key handling
708
static {
709           int end = 8;
710           if (System.getProperty("mrj.version") != null) { //NOI18N
711
// MultiKeyBinding[] nue = new MultiKeyBinding[defaultKeyBindings.length + end];
712
//
713
// nue[0] = new MultiKeyBinding(
714
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.META_MASK),
715
// BaseKit.endLineAction
716
// );
717
//
718
// nue[1] = new MultiKeyBinding(
719
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.META_MASK),
720
// BaseKit.beginLineAction
721
// );
722
//
723
// nue[2] = new MultiKeyBinding(
724
// KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.META_MASK),
725
// BaseKit.beginAction
726
// );
727
//
728
// nue[3] = new MultiKeyBinding(
729
// KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.META_MASK),
730
// BaseKit.endAction
731
// );
732
//
733
// nue[4] = new MultiKeyBinding(
734
// KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.META_MASK | InputEvent.SHIFT_MASK),
735
// BaseKit.selectionEndAction
736
// );
737
//
738
// nue[5] = new MultiKeyBinding(
739
// KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.META_MASK | InputEvent.SHIFT_MASK),
740
// BaseKit.selectionBeginAction
741
// );
742
//
743
// nue[6] = new MultiKeyBinding( //36
744
// KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | InputEvent.META_MASK),
745
// BaseKit.selectionEndLineAction
746
// );
747
//
748
// nue[7] = new MultiKeyBinding( //32
749
// KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | InputEvent.META_MASK),
750
// BaseKit.selectionBeginLineAction
751
// );
752
//
753
//
754
// System.arraycopy(defaultKeyBindings, 0, nue, end, defaultKeyBindings.length);
755
// defaultKeyBindings = nue;
756
}
757       }
758 }
759
Popular Tags