use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class MethodHierarchyNodeDescriptor method update.
public final boolean update() {
int flags = Iconable.ICON_FLAG_VISIBILITY;
if (isMarkReadOnly()) {
flags |= Iconable.ICON_FLAG_READ_STATUS;
}
boolean changes = super.update();
final PsiElement psiClass = getPsiClass();
if (psiClass == null) {
final String invalidPrefix = IdeBundle.message("node.hierarchy.invalid");
if (!myHighlightedText.getText().startsWith(invalidPrefix)) {
myHighlightedText.getBeginning().addText(invalidPrefix, HierarchyNodeDescriptor.getInvalidPrefixAttributes());
}
return true;
}
final Icon newRawIcon = psiClass.getIcon(flags);
final Icon newStateIcon = psiClass instanceof PsiClass ? calculateState((PsiClass) psiClass) : AllIcons.Hierarchy.MethodDefined;
if (changes || newRawIcon != myRawIcon || newStateIcon != myStateIcon) {
changes = true;
myRawIcon = newRawIcon;
myStateIcon = newStateIcon;
Icon newIcon = myRawIcon;
if (myIsBase) {
final LayeredIcon icon = new LayeredIcon(2);
icon.setIcon(newIcon, 0);
icon.setIcon(AllIcons.Hierarchy.Base, 1, -AllIcons.Hierarchy.Base.getIconWidth() / 2, 0);
newIcon = icon;
}
if (myStateIcon != null) {
newIcon = new RowIcon(myStateIcon, newIcon);
}
setIcon(newIcon);
}
final CompositeAppearance oldText = myHighlightedText;
myHighlightedText = new CompositeAppearance();
TextAttributes classNameAttributes = null;
if (myColor != null) {
classNameAttributes = new TextAttributes(myColor, null, null, null, Font.PLAIN);
}
if (psiClass instanceof PsiClass) {
myHighlightedText.getEnding().addText(ClassPresentationUtil.getNameForClass((PsiClass) psiClass, false), classNameAttributes);
myHighlightedText.getEnding().addText(" (" + JavaHierarchyUtil.getPackageName((PsiClass) psiClass) + ")", HierarchyNodeDescriptor.getPackageNameAttributes());
} else if (psiClass instanceof PsiFunctionalExpression) {
myHighlightedText.getEnding().addText(ClassPresentationUtil.getFunctionalExpressionPresentation((PsiFunctionalExpression) psiClass, false));
}
myName = myHighlightedText.getText();
if (!Comparing.equal(myHighlightedText, oldText)) {
changes = true;
}
return changes;
}
use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.
the class ClsMethodImpl 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 ClsClassObjectAccessExpressionImpl method getElementIcon.
@Override
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 LightMethodBuilder method getElementIcon.
@Override
public Icon getElementIcon(final int flags) {
Icon methodIcon = myBaseIcon != null ? myBaseIcon : 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 GrTypeDefinitionImpl method getElementIcon.
@Nullable
@Override
protected Icon getElementIcon(@IconFlags int flags) {
Icon icon = getIconInner();
final boolean isLocked = (flags & ICON_FLAG_READ_STATUS) != 0 && !isWritable();
RowIcon rowIcon = createLayeredIcon(this, icon, ElementPresentationUtil.getFlags(this, isLocked) | getFlagsInner());
if ((flags & ICON_FLAG_VISIBILITY) != 0) {
VisibilityIcons.setVisibilityIcon(getModifierList(), rowIcon);
}
return rowIcon;
}
Aggregations