use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class PsiClassObjectAccessExpressionImpl method getElementIcon.
@Override
@NotNull
public Icon getElementIcon(final int flags) {
final RowIcon rowIcon = ElementBase.createLayeredIcon(this, PlatformIcons.FIELD_ICON, 0);
rowIcon.setIcon(PlatformIcons.PUBLIC_ICON, 1);
return rowIcon;
}
use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class PsiMethodImpl method getElementIcon.
@Override
public Icon getElementIcon(final int flags) {
Icon methodIcon = hasModifierProperty(PsiModifier.ABSTRACT) ? PlatformIcons.ABSTRACT_METHOD_ICON : PlatformIcons.METHOD_ICON;
RowIcon baseIcon = ElementPresentationUtil.createLayeredIcon(methodIcon, this, false);
return ElementPresentationUtil.addVisibilityIcon(this, flags, baseIcon);
}
use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class ElementBase method getElementIcon.
@Nullable
protected Icon getElementIcon(@Iconable.IconFlags int flags) {
final PsiElement element = (PsiElement) this;
if (!element.isValid())
return null;
RowIcon baseIcon;
final boolean isLocked = BitUtil.isSet(flags, ICON_FLAG_READ_STATUS) && !element.isWritable();
int elementFlags = isLocked ? FLAGS_LOCKED : 0;
if (element instanceof ItemPresentation && ((ItemPresentation) element).getIcon(false) != null) {
baseIcon = createLayeredIcon(this, ((ItemPresentation) element).getIcon(false), elementFlags);
} else if (element instanceof PsiFile) {
PsiFile file = (PsiFile) element;
VirtualFile virtualFile = file.getVirtualFile();
final Icon fileTypeIcon;
if (virtualFile == null) {
fileTypeIcon = file.getFileType().getIcon();
} else {
fileTypeIcon = IconUtil.getIcon(virtualFile, flags & ~ICON_FLAG_READ_STATUS, file.getProject());
}
return createLayeredIcon(this, fileTypeIcon, elementFlags);
} else {
return null;
}
return baseIcon;
}
use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class IconUtil method getEmptyIcon.
@NotNull
public static Icon getEmptyIcon(boolean showVisibility) {
RowIcon baseIcon = new RowIcon(2);
baseIcon.setIcon(createEmptyIconLike(PlatformIcons.CLASS_ICON_PATH), 0);
if (showVisibility) {
baseIcon.setIcon(createEmptyIconLike(PlatformIcons.PUBLIC_ICON_PATH), 1);
}
return baseIcon;
}
use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class VisibilityIcons method setVisibilityIcon.
public static void setVisibilityIcon(@MagicConstant(intValues = { PsiUtil.ACCESS_LEVEL_PUBLIC, PsiUtil.ACCESS_LEVEL_PROTECTED, PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL, PsiUtil.ACCESS_LEVEL_PRIVATE }) int accessLevel, RowIcon baseIcon) {
Icon icon;
switch(accessLevel) {
case PsiUtil.ACCESS_LEVEL_PUBLIC:
icon = PlatformIcons.PUBLIC_ICON;
break;
case PsiUtil.ACCESS_LEVEL_PROTECTED:
icon = PlatformIcons.PROTECTED_ICON;
break;
case PsiUtil.ACCESS_LEVEL_PACKAGE_LOCAL:
icon = PlatformIcons.PACKAGE_LOCAL_ICON;
break;
case PsiUtil.ACCESS_LEVEL_PRIVATE:
icon = PlatformIcons.PRIVATE_ICON;
break;
default:
if (PlatformIcons.PUBLIC_ICON != null) {
icon = EmptyIcon.create(PlatformIcons.PUBLIC_ICON);
} else {
return;
}
}
baseIcon.setIcon(icon, 1);
}
Aggregations