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


Java LookupElementBuilder.withBoldness方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.lookup.LookupElementBuilder.withBoldness方法的典型用法代码示例。如果您正苦于以下问题:Java LookupElementBuilder.withBoldness方法的具体用法?Java LookupElementBuilder.withBoldness怎么用?Java LookupElementBuilder.withBoldness使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.lookup.LookupElementBuilder的用法示例。


在下文中一共展示了LookupElementBuilder.withBoldness方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addEnumSuggestions

import com.intellij.codeInsight.lookup.LookupElementBuilder; //导入方法依赖的package包/类
private static void addEnumSuggestions(Editor editor, String val, String suffix, List<LookupElement> answer,
                                       String deprecated, String enums, String defaultValue, boolean xmlMode) {
    String[] parts = enums.split(",");
    for (String part : parts) {
        String lookup = val + part;
        LookupElementBuilder builder = LookupElementBuilder.create(lookup);
        builder = addInsertHandler(editor, suffix, builder, xmlMode);

        // only show the option in the UI
        builder = builder.withPresentableText(part);
        builder = builder.withBoldness(true);
        if ("true".equals(deprecated)) {
            // mark as deprecated
            builder = builder.withStrikeoutness(true);
        }
        boolean isDefaultValue = defaultValue != null && part.equals(defaultValue);
        if (isDefaultValue) {
            builder = builder.withTailText(" (default value)");
            // add default value first in the list
            answer.add(0, builder.withAutoCompletionPolicy(AutoCompletionPolicy.GIVE_CHANCE_TO_OVERWRITE));
        } else {
            answer.add(builder.withAutoCompletionPolicy(AutoCompletionPolicy.GIVE_CHANCE_TO_OVERWRITE));
        }
    }
}
 
开发者ID:camel-idea-plugin,项目名称:camel-idea-plugin,代码行数:26,代码来源:CamelSmartCompletionEndpointValue.java

示例2: addSmartCompletionSuggestionsContextPath

import com.intellij.codeInsight.lookup.LookupElementBuilder; //导入方法依赖的package包/类
public static List<LookupElement> addSmartCompletionSuggestionsContextPath(String val, ComponentModel component,
                                                                           Map<String, String> existing, boolean xmlMode, PsiElement psiElement) {
    List<LookupElement> answer = new ArrayList<>();

    // show the syntax as the only choice for now
    LookupElementBuilder builder = LookupElementBuilder.create(val);
    builder = builder.withIcon(getCamelPreferenceService().getCamelIcon());
    builder = builder.withBoldness(true);
    builder = builder.withPresentableText(component.getSyntax());

    LookupElement element = builder.withAutoCompletionPolicy(AutoCompletionPolicy.NEVER_AUTOCOMPLETE);
    answer.add(element);
    val = removeUnknownEnum(val, psiElement);
    List<LookupElement> old = addSmartCompletionContextPathEnumSuggestions(val, component, existing);
    if (!old.isEmpty()) {
        answer.addAll(old);
    }

    return answer;
}
 
开发者ID:camel-idea-plugin,项目名称:camel-idea-plugin,代码行数:21,代码来源:CamelSmartCompletionEndpointOptions.java

示例3: addAllElementsWithPriority

import com.intellij.codeInsight.lookup.LookupElementBuilder; //导入方法依赖的package包/类
private void addAllElementsWithPriority(@Nullable ArrayList<LookupElementBuilder> lookups, @NotNull CompletionResultSet completionResultSet, double priority, boolean bold) {
    if (lookups != null) {
        for (LookupElementBuilder element : lookups) {
            element = element.withBoldness(bold);
            completionResultSet.addElement(PrioritizedLookupElement.withPriority(element, priority));
        }
    }
}
 
开发者ID:nvlad,项目名称:yii2support,代码行数:9,代码来源:QueryCompletionProvider.java


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