當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。