当前位置: 首页>>代码示例>>Java>>正文


Java TokenContext类代码示例

本文整理汇总了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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ColoringMap.java

示例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
            }
        );

    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:PropertiesSettingsInitializer.java

示例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
                });
    }
}
 
开发者ID:CharlesSkelton,项目名称:studio,代码行数:26,代码来源:QSettingsInitializer.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:ColoringMap.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ColoringMap.java

示例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 }
        );
    }
}
 
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:23,代码来源:PolicySettingsInitializer.java

示例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}
        );
    }
}
 
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:23,代码来源:ManifestSettingsInitializer.java

示例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 }
        );
    }
}
 
开发者ID:bernhardhuber,项目名称:netbeansplugins,代码行数:23,代码来源:ManifestSettingsInitializer.java

示例9: getTokenContextList

import org.netbeans.editor.TokenContext; //导入依赖的package包/类
public static List getTokenContextList() {
    return Arrays.asList(new TokenContext[] {
        JavaTokenContext.context,
        JavaLayerTokenContext.context
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:NbJavaSettingsInitializer.java


注:本文中的org.netbeans.editor.TokenContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。