Java 类com.intellij.util.PsiIconUtil 实例源码

项目:reasonml-idea-plugin    文件:ModuleDotCompletionProvider.java   
static void complete(Project project, PsiModuleName name, @NotNull CompletionResultSet resultSet) {
    // Get the correct module
    Collection<PsiModule> modules = StubIndex.getElements(IndexKeys.MODULES, name.getName(), project, GlobalSearchScope.allScope(project), PsiModule.class);

    if (!modules.isEmpty()) {
        for (PsiModule module : modules) {
            Collection<PsiNamedElement> expressions = module.getExpressions();

            for (PsiNamedElement expression : expressions) {
                resultSet.addElement(
                        LookupElementBuilder.create(expression).
                                withIcon(PsiIconUtil.getProvidersIcon(expression, 0)).
                                withTypeText(PsiInferredTypeUtil.getTypeInfo(expression))
                );
            }
        }
    }
}
项目:intellij-ce-playground    文件:FileIconPatcherImpl.java   
@Override
@Nullable
public Icon getIcon(@NotNull final VirtualFile file, final int flags, final Project project) {
  if (project == null) return null;

  final PsiFileSystemItem psiFile = file.isDirectory() ? PsiManager.getInstance(project).findDirectory(file)
                                                       : PsiManager.getInstance(project).findFile(file);
  return psiFile == null ? null : PsiIconUtil.getProvidersIcon(psiFile, flags);
}
项目:tools-idea    文件:FileIconPatcherImpl.java   
@Override
@Nullable
public Icon getIcon(@NotNull final VirtualFile file, final int flags, final Project project) {
  if(project == null) return null;

  final PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
  return psiFile == null ? null : PsiIconUtil.getProvidersIcon(psiFile, flags);
}