1 19 20 package org.netbeans.modules.editor.html; 21 22 import java.awt.event.KeyEvent ; 23 import java.awt.event.InputEvent ; 24 import java.util.Map ; 25 import java.util.HashMap ; 26 import javax.swing.KeyStroke ; 27 import org.netbeans.editor.MultiKeyBinding; 28 import org.netbeans.editor.Settings; 29 import org.netbeans.editor.SettingsUtil; 30 import org.netbeans.editor.SettingsNames; 31 import org.netbeans.editor.ext.html.HTMLSettingsDefaults; 32 import org.netbeans.editor.ext.html.HTMLSettingsNames; 33 34 40 41 public class NbHTMLSettingsInitializer extends Settings.AbstractInitializer { 42 43 public static final String NAME = "nb-html-settings-initializer"; 45 public NbHTMLSettingsInitializer() { 46 super(NAME); 47 } 48 49 56 public void updateSettingsMap(Class kitClass, Map settingsMap) { 57 58 if (kitClass == HTMLKit.class) { 59 60 settingsMap.put(SettingsNames.CODE_FOLDING_ENABLE, Boolean.TRUE); 61 62 settingsMap.put(HTMLSettingsNames.CODE_FOLDING_UPDATE_TIMEOUT, 63 HTMLSettingsDefaults.defaultCodeFoldingUpdateInterval); 64 65 SettingsUtil.updateListSetting(settingsMap, SettingsNames.KEY_BINDING_LIST, getHTMLKeyBindings()); 66 67 68 } 69 70 } 71 72 public MultiKeyBinding[] getHTMLKeyBindings() { 73 return new MultiKeyBinding[] { 74 new MultiKeyBinding( 75 KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.SHIFT_MASK), 76 HTMLKit.shiftInsertBreakAction 77 ) 78 }; 79 } 80 81 } 82 | Popular Tags |