Component (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean focused) { myTextLabel.clear(); myTextLabel.setIconOnTheRight(false); setPreferredSize(null); MyNode node = extractNode(value); boolean isGroup = node != null && node.getParent() instanceof MyRoot; String name = node != null ? node.myDisplayName : String.valueOf(value); myTextLabel.append(name, isGroup ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES); myTextLabel.setFont(isGroup ? myTree.getFont() : StartupUiUtil.getLabelFont()); // update font color for modified configurables myTextLabel.setForeground(selected ? UIUtil.getTreeSelectionForeground(true) : UIUtil.getTreeForeground()); if (!selected && node != null) { Configurable configurable = node.myConfigurable; if (myFilter.myContext.getErrors().containsKey(configurable)) { myTextLabel.setForeground(WRONG_CONTENT); } else if (myFilter.myContext.getModified().contains(configurable)) { myTextLabel.setForeground(MODIFIED_CONTENT); } } // configure project icon Project project = node != null ? findConfigurableProject(node) : null; Configurable configurable = node != null ? node.myConfigurable : null; setProjectIcon(myProjectIcon, configurable, project, selected); prepareRenderer(node != null, node, configurable, selected); // configure node icon Icon nodeIcon = value instanceof DefaultMutableTreeNode ? getIcon((DefaultMutableTreeNode)value, selected) : null; myNodeIcon.setIcon(nodeIcon); if (configurable instanceof ConfigurableMarkerProvider) { String label = ((ConfigurableMarkerProvider)configurable).getMarkerText(); if (label != null) { myTextLabel.append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES, false); myTextLabel.append(label, SimpleTextAttributes.GRAYED_SMALL_ATTRIBUTES, false); } } if (isBeta(configurable)) { myTextLabel.setIconOnTheRight(true); myTextLabel.setIconTextGap(JBUIScale.scale(8)); myTextLabel.setIcon(AllIcons.General.Beta); } Configurable.Promo promo = asPromo(configurable); if (promo != null) { myTextLabel.setIconOnTheRight(true); myTextLabel.setIconTextGap(JBUIScale.scale(8)); myTextLabel.setIcon(promo.getPromoIcon()); } if (node != null && UISettings.getInstance().getShowInplaceCommentsInternal()) { ConfigurableWrapper wrapper = configurable instanceof ConfigurableWrapper ? ((ConfigurableWrapper)configurable) : null; @NonNls String id = wrapper != null ? wrapper.getId() : configurable instanceof SearchableConfigurable ? ((SearchableConfigurable)configurable).getId() : configurable.getClass().getSimpleName(); PluginDescriptor plugin = wrapper != null ? wrapper.getExtensionPoint().getPluginDescriptor() : null; PluginId pluginId = plugin == null ? null : plugin.getPluginId(); String pluginName = pluginId == null || PluginManagerCore.CORE_ID.equals(pluginId) ? null : plugin.getName(); myTextLabel.append(" ", SimpleTextAttributes.REGULAR_ATTRIBUTES, false); myTextLabel.append(pluginName == null ? id : id + " (" + pluginName + ")", SimpleTextAttributes.GRAYED_SMALL_ATTRIBUTES, false); } // calculate minimum size if (node != null && tree.isVisible()) { int width = getLeftMargin(node.myLevel) + getPreferredSize().width; Insets insets = tree.getInsets(); if (insets != null) { width += insets.left + insets.right; } JScrollBar bar = myScroller.getVerticalScrollBar(); if (bar != null && bar.isVisible()) { width += bar.getWidth(); } width = Math.min(width, 300); // maximal width for minimum size JComponent view = SettingsTreeView.this; Dimension size = view.getMinimumSize(); if (size.width < width) { size.width = width; view.setMinimumSize(size); view.revalidate(); view.repaint(); } } return this; }