@Override
    public Component getTreeCellRendererComponent(JTree tree,
                                                  Object value,
                                                  boolean selected,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus) {
      DefaultMutableTreeNode node = (DefaultMutableTreeNode)value;
      Object object = node.getUserObject();
      myCheckbox.setBackground(UIUtil.getTreeBackground());
      setBackground(UIUtil.getTreeBackground(selected, true));
      Color foreground = UIUtil.getTreeForeground(selected, true);
      setForeground(foreground);
      myCheckbox.setForeground(foreground);
      myLabel.setForeground(foreground);

      if (object == TEMPLATE_ROOT) {
        myCheckbox.setVisible(false);
        myLabel.setIcon(AllIcons.General.Settings);
        myLabel.setText(ExecutionBundle.message("run.configuration.edit.default.configuration.settings.text"));
        return this;
      }
      Descriptor descriptor = (Descriptor)object;

      myCheckbox.setVisible(true);
      myCheckbox.setSelected(descriptor.isChecked());
      myCheckbox.setEnabled(true);

      if (descriptor instanceof ConfigurationTypeDescriptor configurationTypeDescriptor) {
        myLabel.setFont(tree.getFont());
        myLabel.setText(configurationTypeDescriptor.getConfigurationType().getDisplayName());
        myLabel.setIcon(configurationTypeDescriptor.getIcon());
      }
      else if (descriptor instanceof GroupConfigurationDescriptor groupConfigurationDescriptor) {
        myLabel.setIcon(groupConfigurationDescriptor.getIcon());
        myLabel.setText(groupConfigurationDescriptor.getConfigurationType().getDisplayName());
        myLabel.setFont(tree.getFont());
        myCheckbox.setState(getStateFromChildren(node));
      }
      else if (descriptor instanceof ConfigurationDescriptor configurationTypeDescriptor) {
        myLabel.setFont(tree.getFont());
        myLabel.setText(configurationTypeDescriptor.getName());
        myLabel.setIcon(null);

        if (((GroupConfigurationDescriptor)((DefaultMutableTreeNode)node.getParent()).getUserObject()).isChecked()) {
          myCheckbox.setSelected(true);
        }
      }

      return this;
    }
@Override
    public Component getTreeCellRendererComponent(JTree tree,
                                                  Object value,
                                                  boolean selected,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus)