1 19 20 package org.netbeans.editor.ext; 21 22 import java.awt.Color ; 23 import java.awt.Dimension ; 24 import java.awt.event.InputEvent ; 25 import java.awt.event.KeyEvent ; 26 import java.util.Arrays ; 27 import java.util.List ; 28 import java.util.ArrayList ; 29 import java.util.Map ; 30 import java.util.HashMap ; 31 import javax.swing.KeyStroke ; 32 import javax.swing.text.JTextComponent ; 33 import org.netbeans.editor.Coloring; 34 import org.netbeans.editor.Settings; 35 import org.netbeans.editor.SettingsUtil; 36 import org.netbeans.editor.SettingsNames; 37 import org.netbeans.editor.BaseKit; 38 import org.netbeans.editor.MultiKeyBinding; 39 40 46 47 public class ExtSettingsInitializer extends Settings.AbstractInitializer { 48 49 public static final String NAME = "ext-settings-initializer"; 51 public ExtSettingsInitializer() { 52 super(NAME); 53 } 54 55 62 public void updateSettingsMap(Class kitClass, Map settingsMap) { 63 64 71 if (kitClass == ExtKit.class) { 73 74 SettingsUtil.updateListSetting(settingsMap, SettingsNames.COLORING_NAME_LIST, 76 new String [] { 77 ExtSettingsNames.HIGHLIGHT_CARET_ROW_COLORING, 78 ExtSettingsNames.HIGHLIGHT_MATCH_BRACE_COLORING, 79 } 80 ); 81 82 settingsMap.put(ExtSettingsNames.HIGHLIGHT_CARET_ROW, 84 ExtSettingsDefaults.defaultHighlightCaretRow); 85 settingsMap.put(ExtSettingsNames.HIGHLIGHT_MATCH_BRACE, 86 ExtSettingsDefaults.defaultHighlightMatchBrace); 87 88 SettingsUtil.setColoring(settingsMap, ExtSettingsNames.HIGHLIGHT_CARET_ROW_COLORING, 90 ExtSettingsDefaults.defaultHighlightCaretRowColoring); 91 SettingsUtil.setColoring(settingsMap, ExtSettingsNames.HIGHLIGHT_MATCH_BRACE_COLORING, 92 ExtSettingsDefaults.defaultHighlightMatchBraceColoring); 93 94 String [] popupMenuActionNames 96 = new String [] { 97 BaseKit.cutAction, 98 BaseKit.copyAction, 99 BaseKit.pasteAction, 100 null, 101 BaseKit.removeSelectionAction 102 }; 103 104 105 List pml = (List )settingsMap.get(ExtSettingsNames.POPUP_MENU_ACTION_NAME_LIST); 106 if (pml == null || pml.indexOf(BaseKit.cutAction) == -1) { 107 SettingsUtil.updateListSetting(settingsMap, 108 ExtSettingsNames.POPUP_MENU_ACTION_NAME_LIST, popupMenuActionNames); 109 110 SettingsUtil.updateListSetting(settingsMap, 111 ExtSettingsNames.DIALOG_POPUP_MENU_ACTION_NAME_LIST, popupMenuActionNames); 112 } 113 114 settingsMap.put(ExtSettingsNames.POPUP_MENU_ENABLED, Boolean.TRUE); 115 116 settingsMap.put(ExtSettingsNames.FAST_IMPORT_PACKAGE, 117 ExtSettingsDefaults.defaultFastImportPackage); 118 119 settingsMap.put(ExtSettingsNames.COMPLETION_AUTO_POPUP, 121 ExtSettingsDefaults.defaultCompletionAutoPopup); 122 123 settingsMap.put(ExtSettingsNames.COMPLETION_CASE_SENSITIVE, 124 ExtSettingsDefaults.defaultCompletionCaseSensitive); 125 126 settingsMap.put(ExtSettingsNames.COMPLETION_NATURAL_SORT, 127 ExtSettingsDefaults.defaultCompletionNaturalSort); 128 129 settingsMap.put(ExtSettingsNames.COMPLETION_INSTANT_SUBSTITUTION, 130 ExtSettingsDefaults.defaultCompletionInstantSubstitution); 131 132 settingsMap.put(ExtSettingsNames.COMPLETION_AUTO_POPUP_DELAY, 133 ExtSettingsDefaults.defaultCompletionAutoPopupDelay); 134 135 settingsMap.put(ExtSettingsNames.COMPLETION_REFRESH_DELAY, 136 ExtSettingsDefaults.defaultCompletionRefreshDelay); 137 138 settingsMap.put(ExtSettingsNames.COMPLETION_PANE_MIN_SIZE, 139 ExtSettingsDefaults.defaultCompletionPaneMinSize); 140 141 settingsMap.put(ExtSettingsNames.COMPLETION_PANE_MAX_SIZE, 142 ExtSettingsDefaults.defaultCompletionPaneMaxSize); 143 144 settingsMap.put(ExtSettingsNames.REINDENT_WITH_TEXT_BEFORE, 146 Boolean.TRUE); 147 148 settingsMap.put(ExtSettingsNames.JAVADOC_BG_COLOR, 149 ExtSettingsDefaults.defaultJavaDocBGColor); 150 151 settingsMap.put(ExtSettingsNames.JAVADOC_AUTO_POPUP_DELAY, 152 ExtSettingsDefaults.defaultJavaDocAutoPopupDelay); 153 154 settingsMap.put(ExtSettingsNames.JAVADOC_PREFERRED_SIZE, 155 ExtSettingsDefaults.defaultJavaDocPreferredSize); 156 157 settingsMap.put(ExtSettingsNames.JAVADOC_AUTO_POPUP, 158 ExtSettingsDefaults.defaultJavaDocAutoPopup); 159 160 } 161 162 } 163 164 } 165 | Popular Tags |