本文整理汇总了Java中com.intellij.codeInsight.lookup.DefaultLookupItemRenderer类的典型用法代码示例。如果您正苦于以下问题:Java DefaultLookupItemRenderer类的具体用法?Java DefaultLookupItemRenderer怎么用?Java DefaultLookupItemRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultLookupItemRenderer类属于com.intellij.codeInsight.lookup包,在下文中一共展示了DefaultLookupItemRenderer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation) {
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
presentation.setItemText(PsiUtilCore.getName((PsiElement)element));
presentation.setStrikeout(isToStrikeout(item));
presentation.setTailText((String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);
PsiType type = ((BeanPropertyElement)element).getPropertyType();
presentation.setTypeText(type == null ? null : type.getPresentableText());
}
示例2: renderClassItem
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
public static void renderClassItem(LookupElementPresentation presentation, LookupItem item, PsiClass psiClass, boolean diamond) {
if (!(psiClass instanceof PsiTypeParameter)) {
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
}
final boolean bold = item.getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null;
boolean strikeout = JavaElementLookupRenderer.isToStrikeout(item);
presentation.setItemText(getName(psiClass, item, diamond));
presentation.setStrikeout(strikeout);
presentation.setItemTextBold(bold);
String tailText = getLocationString(item);
PsiSubstitutor substitutor = (PsiSubstitutor)item.getAttribute(LookupItem.SUBSTITUTOR);
if (item instanceof PsiTypeLookupItem) {
if (((PsiTypeLookupItem)item).isIndicateAnonymous() &&
(psiClass.isInterface() || psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) ||
((PsiTypeLookupItem)item).isAddArrayInitializer()) {
tailText = "{...}" + tailText;
}
}
if (substitutor == null && !diamond && psiClass.getTypeParameters().length > 0) {
tailText = "<" + StringUtil.join(psiClass.getTypeParameters(), new Function<PsiTypeParameter, String>() {
@Override
public String fun(PsiTypeParameter psiTypeParameter) {
return psiTypeParameter.getName();
}
}, "," + (showSpaceAfterComma(psiClass) ? " " : "")) + ">" + tailText;
}
presentation.setTailText(tailText, true);
}
示例3: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation) {
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
presentation.setItemText(getName(element, item));
presentation.setStrikeout(isToStrikeout(item));
presentation.setItemTextBold(item.getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null);
presentation.setTailText((String)item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);
presentation.setTypeText(getTypeText(element, item));
}
示例4: renderClassItem
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
public static void renderClassItem(LookupElementPresentation presentation,
LookupElement item,
PsiClass psiClass,
boolean diamond,
@NotNull String locationString,
@NotNull PsiSubstitutor substitutor)
{
if(!(psiClass instanceof PsiTypeParameter))
{
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
}
boolean strikeout = JavaElementLookupRenderer.isToStrikeout(item);
presentation.setItemText(getName(psiClass, item, diamond, substitutor));
presentation.setStrikeout(strikeout);
String tailText = locationString;
if(item instanceof PsiTypeLookupItem)
{
if(((PsiTypeLookupItem) item).isIndicateAnonymous() && (psiClass.isInterface() || psiClass.hasModifierProperty(PsiModifier.ABSTRACT)) || ((PsiTypeLookupItem) item)
.isAddArrayInitializer())
{
tailText = "{...}" + tailText;
}
}
if(substitutor == PsiSubstitutor.EMPTY && !diamond && psiClass.getTypeParameters().length > 0)
{
String separator = "," + (showSpaceAfterComma(psiClass) ? " " : "");
tailText = "<" + StringUtil.join(psiClass.getTypeParameters(), PsiTypeParameter::getName, separator) + ">" + tailText;
}
presentation.setTailText(tailText, true);
}
示例5: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(final LookupItem item, final Object element, final LookupElementPresentation presentation)
{
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(item, presentation.isReal()));
presentation.setItemText(PsiUtilCore.getName((PsiElement) element));
presentation.setStrikeout(isToStrikeout(item));
presentation.setTailText((String) item.getAttribute(LookupItem.TAIL_TEXT_ATTR), item.getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);
PsiType type = ((BeanPropertyElement) element).getPropertyType();
presentation.setTypeText(type == null ? null : type.getPresentableText());
}
示例6: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(this, presentation.isReal()));
myHelper.renderElement(presentation, !myHelper.willBeImported(), true, PsiSubstitutor.EMPTY);
}
示例7: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation) {
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(this, presentation.isReal()));
myHelper.renderElement(presentation, null, PsiSubstitutor.EMPTY);
}
示例8: renderElement
import com.intellij.codeInsight.lookup.DefaultLookupItemRenderer; //导入依赖的package包/类
@Override
public void renderElement(LookupElementPresentation presentation)
{
presentation.setIcon(DefaultLookupItemRenderer.getRawIcon(this, presentation.isReal()));
myHelper.renderElement(presentation, !myHelper.willBeImported(), true, PsiSubstitutor.EMPTY);
}