Search in sources :

Example 6 with RowIcon

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;
}
Also used : RowIcon(com.intellij.ui.RowIcon) NotNull(org.jetbrains.annotations.NotNull)

Example 7 with 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);
}
Also used : RowIcon(com.intellij.ui.RowIcon) RowIcon(com.intellij.ui.RowIcon)

Example 8 with RowIcon

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;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) ItemPresentation(com.intellij.navigation.ItemPresentation) PsiFile(com.intellij.psi.PsiFile) RowIcon(com.intellij.ui.RowIcon) RowIcon(com.intellij.ui.RowIcon) EmptyIcon(com.intellij.util.ui.EmptyIcon) LayeredIcon(com.intellij.ui.LayeredIcon) PsiElement(com.intellij.psi.PsiElement) Nullable(org.jetbrains.annotations.Nullable)

Example 9 with RowIcon

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;
}
Also used : RowIcon(com.intellij.ui.RowIcon) NotNull(org.jetbrains.annotations.NotNull)

Example 10 with RowIcon

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);
}
Also used : EmptyIcon(com.intellij.util.ui.EmptyIcon) RowIcon(com.intellij.ui.RowIcon)

Aggregations

RowIcon (com.intellij.ui.RowIcon)34 Nullable (org.jetbrains.annotations.Nullable)10 LayeredIcon (com.intellij.ui.LayeredIcon)7 NotNull (org.jetbrains.annotations.NotNull)7 EmptyIcon (com.intellij.util.ui.EmptyIcon)4 ItemPresentation (com.intellij.navigation.ItemPresentation)2 CompositeAppearance (com.intellij.openapi.roots.ui.util.CompositeAppearance)2 PsiFile (com.intellij.psi.PsiFile)2 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)1 IconLayerProvider (com.intellij.ide.IconLayerProvider)1 Bookmark (com.intellij.ide.bookmarks.Bookmark)1 AbstractTreeNode (com.intellij.ide.util.treeView.AbstractTreeNode)1 StructureViewTestUtil.getIcon (com.intellij.lang.javascript.StructureViewTestUtil.getIcon)1 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)1 FlexBuildConfigurationManager (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager)1 SimpleDataContext (com.intellij.openapi.actionSystem.impl.SimpleDataContext)1 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiElement (com.intellij.psi.PsiElement)1 CandidateInfo (com.intellij.psi.infos.CandidateInfo)1