本文整理匯總了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);
}