void (Object value, boolean expanded, ColoredTreeCellRenderer renderer) { if (!(value instanceof DefaultMutableTreeNode)) return; final Object object = ((DefaultMutableTreeNode)value).getUserObject(); if (object instanceof FileType fileType) { final Icon icon = fileType.getIcon(); renderer.setIcon(icon); renderer.append(getFileTypeNodeName(fileType), SimpleTextAttributes.REGULAR_ATTRIBUTES); } else if (object instanceof Module module) { final Icon icon = ModuleType.get(module).getIcon(); renderer.setIcon(icon); final String moduleName = module.getName(); renderer.append(moduleName, SimpleTextAttributes.REGULAR_ATTRIBUTES); } else if (object instanceof PsiFile psiFile) { final Icon icon = psiFile.getIcon(0); renderer.setIcon(icon); final String fileName = psiFile.getName(); renderer.append(fileName, SimpleTextAttributes.REGULAR_ATTRIBUTES); final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile != null) { renderPath(renderer, virtualFile); } } else if (object instanceof VirtualFile file) { renderer.setIcon(VirtualFilePresentation.getIcon(file)); renderer.append(file.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); renderPath(renderer, file); } }