public void customizeCellRenderer( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (value instanceof PackageDependenciesNode) { PackageDependenciesNode node = (PackageDependenciesNode) value; setIcon(node.getIcon()); setForeground( selected && hasFocus ? UIUtil.getTreeSelectionForeground() : UIUtil.getTreeForeground()); if (!(selected && hasFocus) && node.hasMarked() && !DependencyUISettings.getInstance().UI_FILTER_LEGALS) { setForeground(node.hasUnmarked() ? PARTIAL_INCLUDED : WHOLE_INCLUDED); } append(node.toString(), SimpleTextAttributes.REGULAR_ATTRIBUTES); final String locationString = node.getComment(); if (!StringUtil.isEmpty(locationString)) { append(" (" + locationString + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); } } }
public void customizeCellRenderer( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { PackageDependenciesNode node = (PackageDependenciesNode) value; if (node.isValid()) { setIcon(node.getIcon()); } else { append( UsageViewBundle.message("node.invalid") + " ", SimpleTextAttributes.ERROR_ATTRIBUTES); } append( node.toString(), node.hasMarked() && !selected ? SimpleTextAttributes.ERROR_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES); append(node.getPresentableFilesCount(), SimpleTextAttributes.GRAYED_ATTRIBUTES); }