Search in sources :

Example 1 with PerlItemPresentationSimple

use of com.perl5.lang.perl.idea.presentations.PerlItemPresentationSimple in project Perl5-IDEA by Camelcade.

the class PerlStructureViewElement method getPresentation.

@NotNull
@Override
public ItemPresentation getPresentation() {
    ItemPresentation itemPresentation = createPresentation();
    if ((isInherited() || isImported()) && itemPresentation instanceof PerlItemPresentationBase) {
        if (getValue() instanceof PerlDeprecatable && ((PerlDeprecatable) getValue()).isDeprecated()) {
            ((PerlItemPresentationBase) itemPresentation).setAttributesKey(PerlSyntaxHighlighter.UNUSED_DEPRECATED);
        } else {
            ((PerlItemPresentationBase) itemPresentation).setAttributesKey(CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES);
        }
    }
    if (isImported() && itemPresentation instanceof PerlItemPresentationSimple) {
        PerlExportDescriptor exportDescriptor = getExportDescriptor();
        assert exportDescriptor != null;
        ((PerlItemPresentationSimple) itemPresentation).setPresentableText(exportDescriptor.getImportedName());
    }
    return itemPresentation;
}
Also used : PerlItemPresentationSimple(com.perl5.lang.perl.idea.presentations.PerlItemPresentationSimple) PerlExportDescriptor(com.perl5.lang.perl.extensions.packageprocessor.PerlExportDescriptor) ItemPresentation(com.intellij.navigation.ItemPresentation) PerlItemPresentationBase(com.perl5.lang.perl.idea.presentations.PerlItemPresentationBase) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ItemPresentation (com.intellij.navigation.ItemPresentation)1 PerlExportDescriptor (com.perl5.lang.perl.extensions.packageprocessor.PerlExportDescriptor)1 PerlItemPresentationBase (com.perl5.lang.perl.idea.presentations.PerlItemPresentationBase)1 PerlItemPresentationSimple (com.perl5.lang.perl.idea.presentations.PerlItemPresentationSimple)1 NotNull (org.jetbrains.annotations.NotNull)1