1 19 20 package org.netbeans.modules.editor.plain; 21 22 import java.awt.Color ; 23 import java.awt.Font ; 24 import java.util.Map ; 25 import java.util.HashMap ; 26 import org.netbeans.editor.BaseKit; 27 import org.netbeans.editor.Coloring; 28 import org.netbeans.editor.Settings; 29 import org.netbeans.editor.SettingsUtil; 30 import org.netbeans.editor.TokenCategory; 31 import org.netbeans.editor.TokenContextPath; 32 import org.netbeans.editor.ext.plain.PlainSyntax; 33 import org.netbeans.editor.ext.plain.PlainTokenContext; 34 35 41 42 public class NbPlainSettingsInitializer extends Settings.AbstractInitializer { 43 44 public static final String NAME = "nb-plain-settings-initializer"; 46 public NbPlainSettingsInitializer() { 47 super(NAME); 48 } 49 50 57 public void updateSettingsMap(Class kitClass, Map settingsMap) { 58 59 if (kitClass == BaseKit.class) { 60 61 new PlainTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap); 62 63 } 64 65 66 if (kitClass == PlainKit.class) { 67 68 69 } 70 71 } 72 73 static class PlainTokenColoringInitializer 74 extends SettingsUtil.TokenColoringInitializer { 75 76 Coloring emptyColoring = new Coloring(null, null, null); 77 78 public PlainTokenColoringInitializer() { 79 super(PlainTokenContext.context); 80 } 81 82 public Object getTokenColoring(TokenContextPath tokenContextPath, 83 TokenCategory tokenIDOrCategory, boolean printingSet) { 84 if (!printingSet) { 85 switch (tokenIDOrCategory.getNumericID()) { 86 case PlainTokenContext.TEXT_ID: 87 return emptyColoring; 88 } 89 90 } else { switch (tokenIDOrCategory.getNumericID()) { 92 default: 93 return SettingsUtil.defaultPrintColoringEvaluator; 94 } 95 96 } 97 98 return null; 99 100 } 101 102 } 103 104 } 105 | Popular Tags |