Search in sources :

Example 21 with RowIcon

use of com.intellij.ui.RowIcon in project intellij-elixir by KronicDeth.

the class Quote method getIcon.

/**
     * Returns the icon representing the object.
     *
     * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason.
     */
@Nullable
@Override
public Icon getIcon(boolean unused) {
    RowIcon rowIcon = new RowIcon(2);
    rowIcon.setIcon(ElixirIcons.Time.COMPILE, 0);
    rowIcon.setIcon(PlatformIcons.ANONYMOUS_CLASS_ICON, 1);
    return rowIcon;
}
Also used : RowIcon(com.intellij.ui.RowIcon) Nullable(org.jetbrains.annotations.Nullable)

Example 22 with RowIcon

use of com.intellij.ui.RowIcon in project intellij-elixir by KronicDeth.

the class Quote method getIcon.

/**
     * Returns the icon representing the object.
     *
     * @param unused Used to mean if open/close icons for tree renderer. No longer in use. The parameter is only there for API compatibility reason.
     */
@Nullable
@Override
public Icon getIcon(boolean unused) {
    RowIcon rowIcon = new RowIcon(2);
    rowIcon.setIcon(ElixirIcons.MODULE, 0);
    rowIcon.setIcon(PlatformIcons.ANONYMOUS_CLASS_ICON, 1);
    return rowIcon;
}
Also used : RowIcon(com.intellij.ui.RowIcon) Nullable(org.jetbrains.annotations.Nullable)

Example 23 with RowIcon

use of com.intellij.ui.RowIcon in project intellij-elixir by KronicDeth.

the class PresentationData method icon.

@NotNull
public static Icon icon(final boolean callback, final boolean overridable, final boolean override, @NotNull final Timed.Time time, @Nullable final Visible.Visibility visibility) {
    int layers = 3;
    if (callback) {
        layers++;
    }
    if (overridable) {
        layers++;
    }
    if (override) {
        layers++;
    }
    RowIcon rowIcon = new RowIcon(layers);
    int layer = 0;
    if (callback) {
        rowIcon.setIcon(ElixirIcons.CALLBACK, layer++);
    }
    Icon timeIcon = ElixirIcons.Time.from(time);
    rowIcon.setIcon(timeIcon, layer++);
    Icon visibilityIcon = ElixirIcons.Visibility.from(visibility);
    rowIcon.setIcon(visibilityIcon, layer++);
    rowIcon.setIcon(ElixirIcons.CALL_DEFINITION, layer++);
    if (overridable) {
        rowIcon.setIcon(ElixirIcons.OVERRIDABLE, layer++);
    }
    if (override) {
        rowIcon.setIcon(ElixirIcons.OVERRIDE, layer);
    }
    return rowIcon;
}
Also used : RowIcon(com.intellij.ui.RowIcon) RowIcon(com.intellij.ui.RowIcon) NotNull(org.jetbrains.annotations.NotNull)

Example 24 with RowIcon

use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.

the class BookmarksFavoriteListProvider method customizeRenderer.

@Override
public void customizeRenderer(ColoredTreeCellRenderer renderer, JTree tree, @NotNull Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
    renderer.clear();
    renderer.setIcon(Bookmark.DEFAULT_ICON);
    if (value instanceof Bookmark) {
        Bookmark bookmark = (Bookmark) value;
        BookmarkItem.setupRenderer(renderer, myProject, bookmark, selected);
        if (renderer.getIcon() != null) {
            RowIcon icon = new RowIcon(3, RowIcon.Alignment.CENTER);
            icon.setIcon(bookmark.getIcon(), 0);
            icon.setIcon(JBUI.scale(EmptyIcon.create(1)), 1);
            icon.setIcon(renderer.getIcon(), 2);
            renderer.setIcon(icon);
        } else {
            renderer.setIcon(bookmark.getIcon());
        }
    } else {
        renderer.append(getListName(myProject));
    }
}
Also used : RowIcon(com.intellij.ui.RowIcon)

Example 25 with RowIcon

use of com.intellij.ui.RowIcon in project intellij-community by JetBrains.

the class LightMethod 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)

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