1 19 20 package org.netbeans.editor.ext.java; 21 22 import java.awt.Color ; 23 import java.awt.Font ; 24 import java.awt.event.KeyEvent ; 25 import java.awt.event.InputEvent ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 import java.util.TreeMap ; 29 import org.netbeans.editor.Coloring; 30 import org.netbeans.editor.Settings; 31 import org.netbeans.editor.SettingsUtil; 32 import org.netbeans.editor.SettingsNames; 33 import org.netbeans.editor.SettingsDefaults; 34 import org.netbeans.editor.MultiKeyBinding; 35 import org.netbeans.editor.BaseKit; 36 import org.netbeans.editor.TokenContext; 37 import org.netbeans.editor.TokenContextPath; 38 import org.netbeans.editor.ext.ExtSettingsNames; 39 40 46 47 public class JavaSettingsInitializer extends Settings.AbstractInitializer { 48 49 50 public static final String NAME = "java-settings-initializer"; 52 private Class javaKitClass; 53 54 58 public JavaSettingsInitializer(Class javaKitClass) { 59 super(NAME); 60 this.javaKitClass = javaKitClass; 61 } 62 63 70 public void updateSettingsMap(Class kitClass, Map settingsMap) { 71 72 if (kitClass == BaseKit.class) { 74 75 new JavaSettingsDefaults.JavaTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap); 76 new JavaSettingsDefaults.JavaLayerTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap); 77 78 } 79 80 if (kitClass == javaKitClass) { 81 82 SettingsUtil.updateListSetting(settingsMap, SettingsNames.KEY_BINDING_LIST, 83 JavaSettingsDefaults.getJavaKeyBindings()); 84 85 SettingsUtil.updateListSetting(settingsMap, SettingsNames.TOKEN_CONTEXT_LIST, 86 new TokenContext[] { 87 JavaTokenContext.context, 88 JavaLayerTokenContext.context 89 } 90 ); 91 92 settingsMap.put(SettingsNames.ABBREV_MAP, JavaSettingsDefaults.getJavaAbbrevMap()); 93 94 settingsMap.put(SettingsNames.MACRO_MAP, JavaSettingsDefaults.getJavaMacroMap()); 95 96 settingsMap.put(ExtSettingsNames.CARET_SIMPLE_MATCH_BRACE, 97 JavaSettingsDefaults.defaultCaretSimpleMatchBrace); 98 99 settingsMap.put(ExtSettingsNames.HIGHLIGHT_MATCH_BRACE, 100 JavaSettingsDefaults.defaultHighlightMatchBrace); 101 102 settingsMap.put(SettingsNames.IDENTIFIER_ACCEPTOR, 103 JavaSettingsDefaults.defaultIdentifierAcceptor); 104 105 settingsMap.put(SettingsNames.ABBREV_RESET_ACCEPTOR, 106 JavaSettingsDefaults.defaultAbbrevResetAcceptor); 107 108 settingsMap.put(SettingsNames.WORD_MATCH_MATCH_CASE, 109 JavaSettingsDefaults.defaultWordMatchMatchCase); 110 111 settingsMap.put(SettingsNames.WORD_MATCH_STATIC_WORDS, 112 JavaSettingsDefaults.defaultWordMatchStaticWords); 113 114 settingsMap.put(JavaSettingsNames.JAVA_FORMAT_SPACE_BEFORE_PARENTHESIS, 116 JavaSettingsDefaults.defaultJavaFormatSpaceBeforeParenthesis); 117 118 settingsMap.put(JavaSettingsNames.JAVA_FORMAT_SPACE_AFTER_COMMA, 119 JavaSettingsDefaults.defaultJavaFormatSpaceAfterComma); 120 121 settingsMap.put(JavaSettingsNames.JAVA_FORMAT_NEWLINE_BEFORE_BRACE, 122 JavaSettingsDefaults.defaultJavaFormatNewlineBeforeBrace); 123 124 settingsMap.put(JavaSettingsNames.JAVA_FORMAT_LEADING_SPACE_IN_COMMENT, 125 JavaSettingsDefaults.defaultJavaFormatLeadingSpaceInComment); 126 127 settingsMap.put(JavaSettingsNames.JAVA_FORMAT_LEADING_STAR_IN_COMMENT, 128 JavaSettingsDefaults.defaultJavaFormatLeadingStarInComment); 129 130 settingsMap.put(JavaSettingsNames.INDENT_HOT_CHARS_ACCEPTOR, 131 JavaSettingsDefaults.defaultIndentHotCharsAcceptor); 132 133 settingsMap.put(ExtSettingsNames.REINDENT_WITH_TEXT_BEFORE, 134 Boolean.FALSE); 135 136 settingsMap.put(JavaSettingsNames.PAIR_CHARACTERS_COMPLETION, 137 JavaSettingsDefaults.defaultPairCharactersCompletion); 138 139 settingsMap.put(JavaSettingsNames.GOTO_CLASS_CASE_SENSITIVE, 140 JavaSettingsDefaults.defaultGotoClassCaseSensitive); 141 142 settingsMap.put(JavaSettingsNames.GOTO_CLASS_SHOW_INNER_CLASSES, 143 JavaSettingsDefaults.defaultGotoClassShowInnerClasses); 144 145 settingsMap.put(JavaSettingsNames.GOTO_CLASS_SHOW_LIBRARY_CLASSES, 146 JavaSettingsDefaults.defaultGotoClassShowLibraryClasses); 147 } 148 149 } 150 151 } 152 | Popular Tags |