本文整理匯總了Java中com.intellij.codeInsight.lookup.LookupElement.renderElement方法的典型用法代碼示例。如果您正苦於以下問題:Java LookupElement.renderElement方法的具體用法?Java LookupElement.renderElement怎麽用?Java LookupElement.renderElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.codeInsight.lookup.LookupElement
的用法示例。
在下文中一共展示了LookupElement.renderElement方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doTestTagNameIcons
import com.intellij.codeInsight.lookup.LookupElement; //導入方法依賴的package包/類
private void doTestTagNameIcons(String fileName) throws IOException {
VirtualFile file = copyFileToProject(fileName);
myFixture.configureFromExistingVirtualFile(file);
final LookupElement[] elements = myFixture.complete(CompletionType.BASIC);
final Set<String> elementsToCheck = new HashSet<String>(Arrays.asList(
"view", "include", "requestFocus", "fragment", "Button"));
for (LookupElement element : elements) {
final String s = element.getLookupString();
final Object obj = element.getObject();
if (elementsToCheck.contains(s)) {
LookupElementPresentation presentation = new LookupElementPresentation();
element.renderElement(presentation);
assertNotNull("no icon for element: " + element, presentation.getIcon());
if ("Button".equals(s)) {
assertInstanceOf(obj, PsiClass.class);
}
}
}
}