alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.editor;

import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Dimension;
import java.awt.event.KeyEvent;
import java.awt.event.InputEvent;
import javax.swing.KeyStroke;
import javax.swing.UIManager;
import java.util.Map;
import java.util.HashMap;

/**
* Default values for the settings. They are used
* by BaseSettingsInitializer to initialize
* the settings with the default values. They can be also used
* for substitution if the value of the particular setting
* is unacceptable.
*
* @author Miloslav Metelka
* @version 1.00
*/

public class SettingsDefaults {

    private static final Integer INTEGER_MAX_VALUE = new Integer(Integer.MAX_VALUE);

    // Caret color
    public static final Color defaultCaretColor = Color.black;

    // Empty coloring - it doesn't change font or colors
    public static final Coloring emptyColoring = new Coloring(null, null, null);

    // Default coloring
    private static int defaultFontSize; // Fix of #33249
    static {
        Font systemDefaultFont = UIManager.getFont("TextField.font"); // NOI18N
        defaultFontSize = (systemDefaultFont != null) ? systemDefaultFont.getSize() : 12;
    }

    public static final Font defaultFont = new Font("Monospaced", Font.PLAIN, defaultFontSize); // NOI18N
    public static final Color defaultForeColor = Color.black;
    public static final Color defaultBackColor = Color.white;
    public static final Coloring defaultColoring
    = new Coloring(defaultFont, defaultForeColor, defaultBackColor);
    // line number coloring
    public static final Color defaultLineNumberForeColor = new Color(128, 64, 64);
    public static final Color defaultLineNumberBackColor = new Color(224, 224, 224);
    public static final Coloring defaultLineNumberColoring
    = new Coloring(null, defaultLineNumberForeColor, defaultLineNumberBackColor);
    // caret selection coloring
    public static final Color defaultSelectionForeColor = Color.white;
    public static final Color defaultSelectionBackColor = Color.lightGray;
    public static final Coloring defaultSelectionColoring
    = new Coloring(null, defaultSelectionForeColor, defaultSelectionBackColor);
    // Highlight search coloring
    public static final Color defaultHighlightSearchForeColor = Color.black;
    public static final Color defaultHighlightSearchBackColor = new Color(255, 255, 128);
    public static final Coloring defaultHighlightSearchColoring
    = new Coloring(null, defaultHighlightSearchForeColor, defaultHighlightSearchBackColor);
    // Incremental search coloring
    public static final Color defaultIncSearchForeColor = Color.black;
    public static final Color defaultIncSearchBackColor = new Color(255, 107, 138);
    public static final Coloring defaultIncSearchColoring
    = new Coloring(null, defaultIncSearchForeColor, defaultIncSearchBackColor);
    /*
    // Bookmark coloring
    public static final Color defaultBookmarkForeColor = Color.black;
    public static final Color defaultBookmarkBackColor = new Color(184, 230, 230);
    public static final Coloring defaultBookmarkColoring
    = new Coloring(null, defaultBookmarkForeColor, defaultBookmarkBackColor);
     */
    // Guarded blocks coloring
    public static final Color defaultGuardedForeColor = null;
    public static final Color defaultGuardedBackColor = new Color(225, 236, 247);
    public static final Coloring defaultGuardedColoring
    = new Coloring(null, defaultGuardedForeColor, defaultGuardedBackColor);
    
    // code folding coloring
    public static final Color defaultCodeFoldingForeColor = new Color(102, 102, 102);
    public static final Coloring defaultCodeFoldingColoring
    = new Coloring(null, defaultCodeFoldingForeColor, null);
    
    // code folding bar coloring
    public static final Color defaultCodeFoldingBarForeColor = new Color(102, 102, 102);
    public static final Color defaultCodeFoldingBarBackColor = new Color(240, 240, 240);
    public static final Coloring defaultCodeFoldingBarColoring
    = new Coloring(null, defaultCodeFoldingBarForeColor, defaultCodeFoldingBarBackColor);

    public static final Color defaultStatusBarForeColor = null;
    public static final Color defaultStatusBarBackColor
    = UIManager.getColor("ScrollPane.background"); // NOI18N
    public static final Coloring defaultStatusBarColoring
    = new Coloring(null, defaultStatusBarForeColor, defaultStatusBarBackColor);

    public static final Color defaultStatusBarBoldForeColor = Color.white;
    public static final Color defaultStatusBarBoldBackColor = Color.red;
    public static final Coloring defaultStatusBarBoldColoring
    = new Coloring(null, defaultStatusBarBoldForeColor, defaultStatusBarBoldBackColor);

    public static final Integer defaultCaretBlinkRate = new Integer(300);
    public static final Integer defaultTabSize = new Integer(8);
    public static final Integer defaultSpacesPerTab = new Integer(4);
    public static final Integer defaultShiftWidth = new Integer(4); // usually
    // not used as there's a Evaluator for shift width

    public static final Integer defaultStatusBarCaretDelay = new Integer(200);

    public static final Color defaultTextLimitLineColor = new Color(255, 235, 235);
    public static final Integer defaultTextLimitWidth = new Integer(80);

    public static final Acceptor defaultIdentifierAcceptor = AcceptorFactory.LETTER_DIGIT;
    public static final Acceptor defaultWhitespaceAcceptor = AcceptorFactory.WHITESPACE;

    public static final Float defaultLineHeightCorrection = new Float(1.0f);

    public static final Integer defaultTextLeftMarginWidth = new Integer(2);
    public static final Insets defaultScrollJumpInsets = new Insets(-5, -10, -5, -30);
    public static final Insets defaultScrollFindInsets = new Insets(0, -95, -10, -0);
    public static final Dimension defaultComponentSizeIncrement = new Dimension(-5, -30);

    public static final Integer defaultReadBufferSize = new Integer(16384);
    public static final Integer defaultWriteBufferSize = new Integer(16384);
    public static final Integer defaultReadMarkDistance = new Integer(180);
    public static final Integer defaultMarkDistance = new Integer(100);
    public static final Integer defaultMaxMarkDistance = new Integer(150);
    public static final Integer defaultMinMarkDistance = new Integer(50);
    public static final Integer defaultSyntaxUpdateBatchSize
    = new Integer(defaultMarkDistance.intValue() * 7);
    public static final Integer defaultLineBatchSize = new Integer(2);

    public static final Boolean defaultExpandTabs = Boolean.TRUE;

    public static final String defaultCaretTypeInsertMode = BaseCaret.LINE_CARET;
    public static final String defaultCaretTypeOverwriteMode = BaseCaret.BLOCK_CARET;
    public static final Color defaultCaretColorInsertMode = Color.black;
    public static final Color defaultCaretColorOvwerwriteMode = Color.black;
    public static final Boolean defaultCaretItalicInsertMode = Boolean.FALSE;
    public static final Boolean defaultCaretItalicOverwriteMode = Boolean.FALSE;
    public static final Acceptor defaultAbbrevExpandAcceptor = AcceptorFactory.WHITESPACE;
    public static final Acceptor defaultAbbrevAddTypedCharAcceptor = AcceptorFactory.NL;
    public static final Acceptor defaultAbbrevResetAcceptor = AcceptorFactory.NON_JAVA_IDENTIFIER;
    public static final Map defaultAbbrevMap = new HashMap();

    public static final Map defaultMacroMap = new HashMap();
    
    public static final Boolean defaultStatusBarVisible = Boolean.TRUE;

    public static final Boolean defaultLineNumberVisible = Boolean.FALSE;
    public static final Boolean defaultPrintLineNumberVisible = Boolean.TRUE;
    public static final Boolean defaultTextLimitLineVisible = Boolean.TRUE;
    public static final Boolean defaultHomeKeyColumnOne = Boolean.FALSE;
    public static final Boolean defaultWordMoveNewlineStop = Boolean.TRUE;
    public static final Boolean defaultInputMethodsEnabled = Boolean.TRUE;
    public static final Boolean defaultFindHighlightSearch = Boolean.TRUE;
    public static final Boolean defaultFindIncSearch = Boolean.TRUE;
    public static final Boolean defaultFindBackwardSearch = Boolean.FALSE;
    public static final Boolean defaultFindWrapSearch = Boolean.TRUE;
    public static final Boolean defaultFindMatchCase = Boolean.FALSE;
    public static final Boolean defaultFindWholeWords = Boolean.FALSE;
    public static final Boolean defaultFindRegExp = Boolean.FALSE;
    public static final Integer defaultFindHistorySize = new Integer(30);
    public static final Integer defaultWordMatchSearchLen = INTEGER_MAX_VALUE;
    public static final Boolean defaultWordMatchWrapSearch = Boolean.TRUE;
    public static final Boolean defaultWordMatchMatchOneChar = Boolean.TRUE;
    public static final Boolean defaultWordMatchMatchCase = Boolean.FALSE;
    public static final Boolean defaultWordMatchSmartCase = Boolean.FALSE;
    public static final Boolean defaultCodeFoldingEnable = Boolean.FALSE;
    
    public static final String[] defaultColoringNames
    = new String[] {
          SettingsNames.DEFAULT_COLORING,
          SettingsNames.LINE_NUMBER_COLORING,
          SettingsNames.GUARDED_COLORING,
          SettingsNames.CODE_FOLDING_COLORING,
          SettingsNames.CODE_FOLDING_BAR_COLORING,
          SettingsNames.SELECTION_COLORING,
          SettingsNames.HIGHLIGHT_SEARCH_COLORING,
          SettingsNames.INC_SEARCH_COLORING,
//          SettingsNames.BOOKMARK_COLORING,
          SettingsNames.STATUS_BAR_COLORING,
          SettingsNames.STATUS_BAR_BOLD_COLORING
      };

    public static final MultiKeyBinding[] defaultKeyBindings
    = new MultiKeyBinding[] {
          new MultiKeyBinding(
              (KeyStroke)null, // this assigns the default action to keymap
              BaseKit.defaultKeyTypedAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
              BaseKit.insertBreakAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_MASK),
              BaseKit.splitLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK),
              BaseKit.startNewLineAction
          ),
          
	  // start-new-line-action cannot be registered here as there
	  // is already another action registered for Shift+enter in
	  // the ext-kit. The code is added directly there
	  //           new MultiKeyBinding(
	  //               KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK),
	  //               BaseKit.startNewLineAction
	  //           ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0),
              BaseKit.insertTabAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK),
              BaseKit.removeTabAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0),
              BaseKit.deletePrevCharAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, InputEvent.SHIFT_MASK),
              BaseKit.deletePrevCharAction
          ),
/*          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.deletePrevCharAction
          ),
*/          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),
              BaseKit.deleteNextCharAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0),
              BaseKit.forwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, 0), // keypad right
              BaseKit.forwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK),
              BaseKit.selectionForwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.CTRL_MASK),
              BaseKit.nextWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
              BaseKit.selectionNextWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0),
              BaseKit.backwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, 0), // keypad left
              BaseKit.backwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK),
              BaseKit.selectionBackwardAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.CTRL_MASK),
              BaseKit.previousWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
              BaseKit.selectionPreviousWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
              BaseKit.downAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0), // keypad down
              BaseKit.downAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_MASK),
              BaseKit.selectionDownAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.CTRL_MASK),
              BaseKit.scrollUpAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0),
              BaseKit.upAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0), // keypad up
              BaseKit.upAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_MASK),
              BaseKit.selectionUpAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.CTRL_MASK),
              BaseKit.scrollDownAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
              BaseKit.pageDownAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.SHIFT_MASK),
              BaseKit.selectionPageDownAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
              BaseKit.pageUpAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_MASK),
              BaseKit.selectionPageUpAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0),
              BaseKit.beginLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK),
              BaseKit.selectionBeginLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.CTRL_MASK),
              BaseKit.beginAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_HOME, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
              BaseKit.selectionBeginAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_END, 0),
              BaseKit.endLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK),
              BaseKit.selectionEndLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.CTRL_MASK),
              BaseKit.endAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_END, InputEvent.SHIFT_MASK | InputEvent.CTRL_MASK),
              BaseKit.selectionEndAction
          ),

          // clipboard bindings
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
              BaseKit.copyAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.CTRL_MASK),
              BaseKit.copyAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_COPY, 0),
              BaseKit.copyAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, InputEvent.SHIFT_MASK),
              BaseKit.cutAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK),
              BaseKit.cutAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_CUT, 0),
              BaseKit.cutAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
              BaseKit.pasteAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, InputEvent.SHIFT_MASK),
              BaseKit.pasteAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PASTE, 0),
              BaseKit.pasteAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.pasteFormatedAction
          ),

          // undo and redo bindings - handled at system level
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK),
              BaseKit.undoAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_UNDO, 0),
              BaseKit.undoAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK),
              BaseKit.redoAction
          ),

          // other bindings
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK),
              BaseKit.selectAllAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
              },
              BaseKit.endWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_W, InputEvent.CTRL_MASK),
              BaseKit.removeWordAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.CTRL_MASK),
              BaseKit.removeLineBeginAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.CTRL_MASK),
              BaseKit.removeLineAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0),
              BaseKit.toggleTypingModeAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK),
              BaseKit.toggleBookmarkAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0),
              BaseKit.gotoNextBookmarkAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0),
              BaseKit.findNextAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK),
              BaseKit.findPreviousAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.CTRL_MASK),
              BaseKit.findSelectionAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
              BaseKit.toggleHighlightSearchAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.CTRL_MASK),
              BaseKit.wordMatchNextAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.CTRL_MASK),
              BaseKit.wordMatchPrevAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK),
              BaseKit.shiftLineRightAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_MASK),
              BaseKit.shiftLineLeftAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.SHIFT_MASK),
              BaseKit.abbrevResetAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.annotationsCyclingAction
          ),

          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_T, 0),
              },
              BaseKit.adjustWindowTopAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_M, 0),
              },
              BaseKit.adjustWindowCenterAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_B, 0),
              },
              BaseKit.adjustWindowBottomAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.SHIFT_MASK | InputEvent.ALT_MASK),
              BaseKit.adjustCaretTopAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.SHIFT_MASK | InputEvent.ALT_MASK),
              BaseKit.adjustCaretCenterAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.SHIFT_MASK | InputEvent.ALT_MASK),
              BaseKit.adjustCaretBottomAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK ),
              BaseKit.formatAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.ALT_MASK),
              BaseKit.selectIdentifierAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.ALT_MASK),
              BaseKit.jumpListPrevAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.ALT_MASK),
              BaseKit.jumpListNextAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_K, InputEvent.SHIFT_MASK | InputEvent.ALT_MASK),
              BaseKit.jumpListPrevComponentAction
          ),
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.SHIFT_MASK | InputEvent.ALT_MASK),
              BaseKit.jumpListNextComponentAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, 0),
              },
              BaseKit.toUpperCaseAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_L, 0),
              },
              BaseKit.toLowerCaseAction
          ),
          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_U, InputEvent.ALT_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_R, 0),
              },
              BaseKit.switchCaseAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.CTRL_MASK),
              BaseKit.selectNextParameterAction
          ),

          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_S, 0),
              },
              BaseKit.startMacroRecordingAction
          ),

          new MultiKeyBinding(
              new KeyStroke[] {
                  KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.CTRL_MASK),
                  KeyStroke.getKeyStroke(KeyEvent.VK_E, 0),
              },
              BaseKit.stopMacroRecordingAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK),
              BaseKit.collapseFoldAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK),
              BaseKit.expandFoldAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.collapseAllFoldsAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_ADD, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.expandAllFoldsAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK),
              BaseKit.collapseFoldAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK),
              BaseKit.expandFoldAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK),
              BaseKit.expandFoldAction
          ),

          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.collapseAllFoldsAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.expandAllFoldsAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, InputEvent.CTRL_MASK | InputEvent.SHIFT_MASK),
              BaseKit.expandAllFoldsAction
          ),
          
          new MultiKeyBinding(
              KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.ALT_MASK | InputEvent.SHIFT_MASK),
              "dump-view-hierarchy" // NOI18N
          )
          
      };
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.