Component (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { myLeftComponent.clear(); myRightComponent.clear(); setBackground(RenderingUtil.getBackground(tree, selected)); myLeftComponent.setForeground(selected ? UIUtil.getTreeSelectionForeground(hasFocus) : null); myRightComponent.setForeground(selected ? UIUtil.getTreeSelectionForeground(hasFocus) : null); if (value == tree.getModel().getRoot()) { myLeftComponent.append(MavenProjectBundle.message("maven.search.artifract.results"), SimpleTextAttributes.REGULAR_ATTRIBUTES); } else if (value instanceof MavenArtifactSearchResult) { formatSearchResult(tree, (MavenArtifactSearchResult)value, selected); } else if (value instanceof MavenDependencyCompletionItem info) { String version = info.getVersion(); Icon icon = MavenDependencyCompletionUtil.getIcon(info.getType()); String managedVersion = myManagedDependenciesMap.get(Pair.create(info.getGroupId(), info.getArtifactId())); if (managedVersion != null && managedVersion.equals(version)) { myLeftComponent.setIcon(icon); myLeftComponent.append(version, SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES); myLeftComponent.append(MavenProjectBundle.message("from.dependency.management"), SimpleTextAttributes.GRAYED_ATTRIBUTES); } else { myLeftComponent.setIcon(icon); myLeftComponent.append(version, SimpleTextAttributes.REGULAR_ATTRIBUTES); } } return this; }