本文整理汇总了Java中org.netbeans.editor.TokenContext类的典型用法代码示例。如果您正苦于以下问题:Java TokenContext类的具体用法?Java TokenContext怎么用?Java TokenContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TokenContext类属于org.netbeans.editor包,在下文中一共展示了TokenContext类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ColoringMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
private ColoringMap(
List<String> legacyNonTokenColoringNames,
Language<?> lexerLanguage,
List<? extends TokenContext> syntaxLanguages,
Lookup.Result<FontColorSettings> lookupResult
) {
this.legacyNonTokenColoringNames = legacyNonTokenColoringNames;
this.lexerLanguage = lexerLanguage;
this.syntaxLanguages = syntaxLanguages;
this.lookupResult = lookupResult;
this.map = loadTheMap(
legacyNonTokenColoringNames,
lexerLanguage,
syntaxLanguages,
lookupResult.allInstances()
);
this.lookupResult.addLookupListener(WeakListeners.create(LookupListener.class, lookupListener, this.lookupResult));
}
示例2: updateSettingsMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
public void updateSettingsMap (Class kitClass, Map settingsMap) {
// Properties colorings
if (kitClass == BaseKit.class) {
new PropertiesTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap);
}
if (kitClass == propertiesClass) {
settingsMap.put (org.netbeans.editor.SettingsNames.ABBREV_MAP, getPropertiesAbbrevMap());
SettingsUtil.updateListSetting(settingsMap, SettingsNames.TOKEN_CONTEXT_LIST,
new TokenContext[] {
PropertiesTokenContext.context
}
);
}
}
示例3: updateSettingsMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
public void updateSettingsMap(Class kitClass,Map settingsMap)
{
if(kitClass==BaseKit.class)
{
QTokenColoringInitializer colorInitializer=new QTokenColoringInitializer();
colorInitializer.updateSettingsMap(kitClass,settingsMap);
}
if(kitClass==QKit.class)
{
settingsMap.put(SettingsNames.LINE_NUMBER_VISIBLE,Boolean.TRUE);
HashMap hints=new HashMap();
// TODO: Detect if JDK6.0 and, if so, update VALUE_TEXT_ANTIALIAS_ON with other settings
hints.put(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
settingsMap.put(SettingsNames.RENDERING_HINTS,hints);
SettingsUtil.updateListSetting(
settingsMap,
SettingsNames.TOKEN_CONTEXT_LIST,
new TokenContext[]
{
QTokenContext.context
});
}
}
示例4: loadTheMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
private static Map<String, Coloring> loadTheMap(
List<String> legacyNonTokenColoringNames,
Language<?> lexerLanguage,
List<? extends TokenContext> syntaxLanguages,
Collection<? extends FontColorSettings> fontsColors
) {
HashMap<String, Coloring> coloringMap = new HashMap<String, Coloring>();
if (!fontsColors.isEmpty()) {
FontColorSettings fcs = fontsColors.iterator().next();
if (legacyNonTokenColoringNames != null) {
collectLegacyNonTokenColorings(coloringMap, legacyNonTokenColoringNames, fcs);
}
collectNonTokenColorings(coloringMap, fcs);
if (syntaxLanguages != null) {
collectLegacyTokenColorings(coloringMap, syntaxLanguages, fcs);
}
if (lexerLanguage != null) {
collectTokenColorings(coloringMap, lexerLanguage, fcs);
}
}
return Collections.unmodifiableMap(coloringMap);
}
示例5: findSyntaxLanguage
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
private static List<? extends TokenContext> findSyntaxLanguage(MimePath mimePath) {
Preferences prefs = MimeLookup.getLookup(mimePath).lookup(Preferences.class);
@SuppressWarnings("unchcecked")
List<? extends TokenContext> languages = (List<? extends TokenContext>) SettingsConversions.callFactory(
prefs, mimePath, "token-context-list", null); //NOI18N
return languages;
}
示例6: updateSettingsMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
/**
* Update map filled with the settings.
*
* @param kitClass kit class for which the settings are being updated.
* It is always non-null value.
* @param settingsMap map holding [setting-name, setting-value] pairs.
* The map can be empty if this is the first initializer
* that updates it or if no previous initializers updated it.
*/
public void updateSettingsMap(Class kitClass, Map settingsMap) {
if (kitClass == BaseKit.class) {
new PolicyTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap);
}
if (kitClass == PolicyEditorKit.class) {
SettingsUtil.updateListSetting(
settingsMap,
SettingsNames.TOKEN_CONTEXT_LIST,
new TokenContext[] { PolicyTokenContext.context }
);
}
}
示例7: updateSettingsMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
/**
* Update map filled with the settings.
*
* @param kitClass kit class for which the settings are being updated. It is
* always non-null value.
* @param settingsMap map holding [setting-name, setting-value] pairs. The
* map can be empty if this is the first initializer that updates it or if
* no previous initializers updated it.
*/
public void updateSettingsMap(Class kitClass, Map settingsMap) {
if (kitClass == BaseKit.class) {
new ManifestTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap);
}
if (kitClass == ManifestEditorKit.class) {
SettingsUtil.updateListSetting(
settingsMap,
SettingsNames.TOKEN_CONTEXT_LIST,
new TokenContext[]{ManifestTokenContext.context}
);
}
}
示例8: updateSettingsMap
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
/**
* Update map filled with the settings.
*
* @param kitClass kit class for which the settings are being updated.
* It is always non-null value.
* @param settingsMap map holding [setting-name, setting-value] pairs.
* The map can be empty if this is the first initializer
* that updates it or if no previous initializers updated it.
*/
public void updateSettingsMap(Class kitClass, Map settingsMap) {
if (kitClass == BaseKit.class) {
new ManifestTokenColoringInitializer().updateSettingsMap(kitClass, settingsMap);
}
if (kitClass == ManifestEditorKit.class) {
SettingsUtil.updateListSetting(
settingsMap,
SettingsNames.TOKEN_CONTEXT_LIST,
new TokenContext[] { ManifestTokenContext.context }
);
}
}
示例9: getTokenContextList
import org.netbeans.editor.TokenContext; //导入依赖的package包/类
public static List getTokenContextList() {
return Arrays.asList(new TokenContext[] {
JavaTokenContext.context,
JavaLayerTokenContext.context
});
}