本文整理匯總了Java中com.intellij.codeInsight.lookup.LookupElement.EMPTY_ARRAY屬性的典型用法代碼示例。如果您正苦於以下問題:Java LookupElement.EMPTY_ARRAY屬性的具體用法?Java LookupElement.EMPTY_ARRAY怎麽用?Java LookupElement.EMPTY_ARRAY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.codeInsight.lookup.LookupElement
的用法示例。
在下文中一共展示了LookupElement.EMPTY_ARRAY屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: calculateLookupItems
@Override
public LookupElement[] calculateLookupItems(@NotNull Expression[] params, ExpressionContext context) {
if (params.length == 0) return LookupElement.EMPTY_ARRAY;
Result paramResult = params[0].calculateQuickResult(context);
if (paramResult instanceof PsiTypeResult) {
final PsiType type = ((PsiTypeResult)paramResult).getType();
final PsiFile file = PsiDocumentManager.getInstance(context.getProject()).getPsiFile(context.getEditor().getDocument());
final PsiElement element = file.findElementAt(context.getStartOffset());
final Set<LookupElement> set = new LinkedHashSet<LookupElement>();
JavaTemplateUtil.addTypeLookupItem(set, type);
CodeInsightUtil.processSubTypes(type, element, false, PrefixMatcher.ALWAYS_TRUE, new Consumer<PsiType>() {
@Override
public void consume(PsiType psiType) {
JavaTemplateUtil.addTypeLookupItem(set, psiType);
}
});
return set.toArray(new LookupElement[set.size()]);
}
return LookupElement.EMPTY_ARRAY;
}
示例2: calculateLookupItems
@Override
public LookupElement[] calculateLookupItems(@NotNull Expression[] params, ExpressionContext context) {
final Query<PsiMember> query = findAnnotated(context, params);
if (query != null) {
Set<LookupElement> set = new LinkedHashSet<LookupElement>();
final String secondParamValue = params.length > 1 ? params[1].calculateResult(context).toString() : null;
final boolean isShortName = secondParamValue != null && !Boolean.valueOf(secondParamValue);
final Project project = context.getProject();
final PsiClass findInClass = secondParamValue != null
? JavaPsiFacade.getInstance(project).findClass(secondParamValue, GlobalSearchScope.allScope(project))
: null;
for (PsiMember object : query.findAll()) {
if (findInClass != null && !object.getContainingClass().equals(findInClass)) continue;
boolean isClazz = object instanceof PsiClass;
final String name = isShortName || !isClazz ? object.getName() : ((PsiClass) object).getQualifiedName();
set.add(LookupElementBuilder.create(name));
}
return set.toArray(new LookupElement[set.size()]);
}
return LookupElement.EMPTY_ARRAY;
}
示例3: calculateLookupItems
@Override
public LookupElement[] calculateLookupItems(@NotNull Expression[] params, ExpressionContext context) {
Object o = runIt(params, context);
if (o != null) {
Set<LookupElement> set = new LinkedHashSet<LookupElement>();
set.add(LookupElementBuilder.create(o.toString()));
return set.toArray(new LookupElement[set.size()]);
}
return LookupElement.EMPTY_ARRAY;
}
示例4: getLookupElements
@Override
@Nullable
public LookupElement[] getLookupElements() {
LookupImpl lookup = getLookup();
if (lookup == null) {
return myEmptyLookup ? LookupElement.EMPTY_ARRAY : null;
}
else {
final List<LookupElement> list = lookup.getItems();
return list.toArray(new LookupElement[list.size()]);
}
}
示例5: runCompletion
private LookupElement[] runCompletion() {
myFixture.configureByFiles(getTestCompletionFilePath());
final LookupElement[] lookupElements =
myFixture.complete(CompletionType.BASIC, MethodsChainsCompletionContributor.INVOCATIONS_THRESHOLD);
return lookupElements == null ? LookupElement.EMPTY_ARRAY : lookupElements;
}
示例6: calculateLookupItems
@Override
public LookupElement[] calculateLookupItems(ExpressionContext expressionContext) {
return LookupElement.EMPTY_ARRAY;
}
示例7: calculateLookupItems
@Override
public LookupElement[] calculateLookupItems(ExpressionContext context) {
return LookupElement.EMPTY_ARRAY;
}