001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.editor.ext;
043:
044: import java.awt.Color;
045: import java.awt.Dimension;
046: import java.awt.event.InputEvent;
047: import java.awt.event.KeyEvent;
048: import java.util.Arrays;
049: import java.util.List;
050: import java.util.ArrayList;
051: import java.util.Map;
052: import java.util.HashMap;
053: import javax.swing.KeyStroke;
054: import javax.swing.text.JTextComponent;
055: import org.netbeans.editor.Coloring;
056: import org.netbeans.editor.Settings;
057: import org.netbeans.editor.SettingsUtil;
058: import org.netbeans.editor.SettingsNames;
059: import org.netbeans.editor.SettingsDefaults;
060: import org.netbeans.editor.BaseKit;
061: import org.netbeans.editor.MultiKeyBinding;
062:
063: /**
064: * Initializer for the extended editor settings.
065: *
066: * @author Miloslav Metelka
067: * @version 1.00
068: */
069:
070: public class ExtSettingsDefaults extends SettingsDefaults {
071:
072: // Highlight row with caret coloring
073: public static final Color defaultHighlightCaretRowBackColor = new Color(
074: 255, 255, 220);
075: public static final Coloring defaultHighlightCaretRowColoring = new Coloring(
076: null, null, defaultHighlightCaretRowBackColor);
077: // Highlight matching brace coloring
078: public static final Color defaultHighlightMatchBraceForeColor = Color.white;
079: public static final Color defaultHighlightMatchBraceBackColor = new Color(
080: 255, 50, 210);
081: public static final Coloring defaultHighlightMatchBraceColoring = new Coloring(
082: null, defaultHighlightMatchBraceForeColor,
083: defaultHighlightMatchBraceBackColor);
084:
085: public static final Boolean defaultHighlightCaretRow = Boolean.TRUE;
086: public static final Boolean defaultHighlightMatchBrace = Boolean.TRUE;
087: public static final Integer defaultHighlightMatchBraceDelay = new Integer(
088: 100);
089: public static final Boolean defaultCaretSimpleMatchBrace = Boolean.TRUE;
090:
091: public static final Boolean defaultCompletionAutoPopup = Boolean.TRUE;
092: public static final Boolean defaultCompletionCaseSensitive = Boolean.FALSE;
093: public static final Boolean defaultCompletionNaturalSort = Boolean.FALSE;
094: public static final Integer defaultCompletionAutoPopupDelay = new Integer(
095: 250);
096: public static final Integer defaultCompletionRefreshDelay = new Integer(
097: 200);
098: public static final Dimension defaultCompletionPaneMaxSize = new Dimension(
099: 400, 300);
100: public static final Dimension defaultCompletionPaneMinSize = new Dimension(
101: 60, 17);
102: public static final Boolean defaultFastImportPackage = Boolean.FALSE;
103: public static final Integer defaultFastImportSelection = new Integer(
104: 0);
105: public static final Boolean defaultShowDeprecatedMembers = Boolean.TRUE;
106: public static final Boolean defaultCompletionInstantSubstitution = Boolean.TRUE;
107:
108: public static final Color defaultJavaDocBGColor = new Color(247,
109: 247, 255);
110: public static final Integer defaultJavaDocAutoPopupDelay = new Integer(
111: 200);
112: public static final Dimension defaultJavaDocPreferredSize = new Dimension(
113: 500, 300);
114: public static final Boolean defaultJavaDocAutoPopup = Boolean.TRUE;
115: private static int MENU_MASK = java.awt.Toolkit.getDefaultToolkit()
116: .getMenuShortcutKeyMask();
117:
118: // public static final MultiKeyBinding[] defaultExtKeyBindings
119: // = new MultiKeyBinding[] {
120: // /*new MultiKeyBinding(
121: // KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.ALT_MASK),
122: // ExtKit.gotoDeclarationAction
123: // ),
124: // */
125: // new MultiKeyBinding(
126: // KeyStroke.getKeyStroke(KeyEvent.VK_F, MENU_MASK),
127: // ExtKit.findAction
128: // ),
129: // new MultiKeyBinding(
130: // KeyStroke.getKeyStroke(KeyEvent.VK_FIND, 0),
131: // ExtKit.findAction
132: // ),
133: // new MultiKeyBinding(
134: // KeyStroke.getKeyStroke(KeyEvent.VK_H, MENU_MASK),
135: // ExtKit.replaceAction
136: // ),
137: // new MultiKeyBinding(
138: // KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_MASK),
139: // ExtKit.gotoAction
140: // ),
141: // new MultiKeyBinding(
142: // KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, InputEvent.CTRL_MASK),
143: // ExtKit.completionShowAction
144: // ),
145: // new MultiKeyBinding( // Japanese Solaris uses CTRL+SPACE for IM
146: // KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, InputEvent.CTRL_MASK),
147: // ExtKit.completionShowAction
148: // ),
149: ///* new MultiKeyBinding(
150: // KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
151: // ExtKit.escapeAction
152: // ),*/
153: // new MultiKeyBinding(
154: // KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK),
155: // ExtKit.matchBraceAction
156: // ),
157: // new MultiKeyBinding(
158: // KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, MENU_MASK | InputEvent.SHIFT_MASK),
159: // ExtKit.selectionMatchBraceAction
160: // ),
161: // new MultiKeyBinding(
162: // KeyStroke.getKeyStroke(KeyEvent.VK_F10, InputEvent.SHIFT_MASK),
163: // ExtKit.showPopupMenuAction
164: // ),
165: // /* new MultiKeyBinding(
166: // KeyStroke.getKeyStroke(KeyEvent.VK_U, MENU_MASK),
167: // // KeyStroke.getKeyStroke(KeyEvent.VK_BRACELEFT, MENU_MASK),
168: // ExtKit.braceCodeSelectAction
169: // ),
170: // */
171: //
172: // };
173:
174: }
|