Problems with IntelliJ 9.0.2 and IconProvider


I have some problems with IntelliJ 9.0.2 and IconProvider.

I described my IconProvider implementation in plugin xml:

<extensions defaultExtensionNs="com.intellij">

        <iconProvider implementation="com…..ProjectIconProvider"/>


My IconProvider realization:

public class ProjectIconProvider extends IconProvider {


    public Icon getIcon(@NotNull PsiElement psiElement, int i) {

        ResourcesManager rManager = ResourcesManager.getInstance();

        VirtualFile element = null;

        element = PsiUtil.getVirtualFile((PsiElement) psiElement);

        if (element != null && element.isDirectory()) {

            return null;


        ElementStatusData status = rManager.getElementStatus(element.getPath(), psiElement.getProject(), false);

        return getRowIcon(element, status); // return some icon






My Icons correctly show for all files except java, which are located in source folder and is empty or don’t contains class word, for this files are show default icon not my.

Could you explain me why this happens, and how can I fix this.

Thank you.

Please sign in to leave a comment.