use of com.intellij.openapi.util.Iconable in project intellij-community by JetBrains.
the class DefaultLookupItemRenderer method _getRawIcon.
@Nullable
private static Icon _getRawIcon(LookupElement item, boolean real) {
if (item instanceof LookupItem) {
Icon icon = (Icon) ((LookupItem) item).getAttribute(LookupItem.ICON_ATTR);
if (icon != null)
return icon;
}
Object o = item.getObject();
if (!real) {
if (item.getObject() instanceof String) {
return EmptyIcon.ICON_0;
}
return EmptyIcon.create(SAMPLE_ICON.getIconWidth() * 2, SAMPLE_ICON.getIconHeight());
}
if (o instanceof Iconable && !(o instanceof PsiElement)) {
return ((Iconable) o).getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
final PsiElement element = item.getPsiElement();
if (element != null && element.isValid()) {
return element.getIcon(Iconable.ICON_FLAG_VISIBILITY);
}
return null;
}
Aggregations