本文整理汇总了Java中com.intellij.codeInsight.lookup.LookupElement.putUserData方法的典型用法代码示例。如果您正苦于以下问题:Java LookupElement.putUserData方法的具体用法?Java LookupElement.putUserData怎么用?Java LookupElement.putUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.lookup.LookupElement
的用法示例。
在下文中一共展示了LookupElement.putUserData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doProcessMembers
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
private void doProcessMembers(boolean acceptMethods,
Consumer<LookupElement> results,
boolean isExpectedTypeMember, Collection<? extends PsiElement> declarations) {
for (final PsiElement result : declarations) {
if (result instanceof PsiMember && !(result instanceof PsiClass)) {
final PsiMember member = (PsiMember)result;
if (!member.hasModifierProperty(PsiModifier.STATIC)) continue;
if (result instanceof PsiField && !member.hasModifierProperty(PsiModifier.FINAL)) continue;
if (result instanceof PsiMethod && (!acceptMethods || myPlaceMethods.contains(result))) continue;
if (JavaCompletionUtil.isInExcludedPackage(member, false) || myImportedStatically.contains(member)) continue;
if (!JavaPsiFacade.getInstance(myPlace.getProject()).getResolveHelper().isAccessible(member, myPlace, null)) {
continue;
}
final LookupElement item = result instanceof PsiMethod ? createMethodElement((PsiMethod)result) : createFieldElement((PsiField)result);
if (item != null) {
item.putUserData(EXPECTED_TYPE_MEMBER, isExpectedTypeMember);
results.consume(AutoCompletionPolicy.NEVER_AUTOCOMPLETE.applyPolicy(item));
}
}
}
}
示例2: addElementLookupItem
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public static LookupElement addElementLookupItem(Set<LookupElement> items, PsiElement element) {
final LookupElement item = LookupItemUtil.objectToLookupItem(element);
items.add(item);
item.putUserData(TemplateLookupSelectionHandler.KEY_IN_LOOKUP_ITEM, new JavaTemplateLookupSelectionHandler());
return item;
}
示例3: addTypeLookupItem
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public static LookupElement addTypeLookupItem(Set<LookupElement> items, PsiType type) {
final LookupElement item = PsiTypeLookupItem.createLookupItem(type, null);
items.add(item);
item.putUserData(TemplateLookupSelectionHandler.KEY_IN_LOOKUP_ITEM, new JavaTemplateLookupSelectionHandler());
return item;
}
示例4: clearBaseStatisticsInfo
import com.intellij.codeInsight.lookup.LookupElement; //导入方法依赖的package包/类
public static void clearBaseStatisticsInfo(LookupElement item) {
item.putUserData(BASE_STATISTICS_INFO, null);
}