/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ui.popup.list;

import com.intellij.openapi.ui.popup.ListItemDescriptor;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.ErrorLabel;
import com.intellij.ui.GroupedElementsRenderer;
import com.intellij.ui.components.panels.OpaquePanel;

import javax.swing.*;
import java.awt.*;

public class GroupedItemsListRenderer extends GroupedElementsRenderer.List implements ListCellRenderer {
  protected ListItemDescriptor myDescriptor;

  protected JLabel myNextStepLabel;

  public JLabel getNextStepLabel() {
    return myNextStepLabel;
  }


  public GroupedItemsListRenderer(ListItemDescriptor descriptor) {
    myDescriptor = descriptor;
  }

  @Override
  public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    String caption = myDescriptor.getCaptionAboveOf(value);
    boolean hasSeparator = myDescriptor.hasSeparatorAboveOf(value);
    if (index == 0 && StringUtil.isEmptyOrSpaces(caption)) hasSeparator = false;

    Icon icon = myDescriptor.getIconFor(value);
    final JComponent result = configureComponent(myDescriptor.getTextFor(value), myDescriptor.getTooltipFor(value),
                                                 icon, icon, isSelected, hasSeparator,
                                                 caption, -1);
    customizeComponent(list, value, isSelected);
    return result;
  }


  @Override
  protected JComponent createItemComponent() {
    myTextLabel = new ErrorLabel();
    myTextLabel.setOpaque(true);
    myTextLabel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

    return layoutComponent(myTextLabel);
  }

  protected final JComponent layoutComponent(JComponent middleItemComponent) {
    JPanel result = new OpaquePanel(new BorderLayout(4, 4), Color.white);

    myNextStepLabel = new JLabel();
    myNextStepLabel.setOpaque(true);

    result.add(middleItemComponent, BorderLayout.CENTER);
    result.add(myNextStepLabel, BorderLayout.EAST);

    result.setBorder(getDefaultItemComponentBorder());

    return result;
  }

  protected void customizeComponent(JList list, Object value, boolean isSelected) {
  }


}

@@ -20,10 +20,10 @@
 0-20
-09
+14
  Jet
@@ -688,16 +688,68 @@
 riptor;%0A
+import com.intellij.openapi.util.registry.Registry;%0A
 import c
@@ -790,16 +790,54 @@
 ngUtil;%0A
+import com.intellij.ui.EngravedLabel;%0A
 import c
@@ -859,24 +859,53 @@
 ErrorLabel;%0A
+import com.intellij.ui.Gray;%0A
 import com.i
@@ -2193,24 +2193,77 @@
 mponent() %7B%0A
+    if (Registry.is(%22ide.new.project.settings%22)) %7B%0A  
     myTextLa
@@ -2273,20 +2273,23 @@
  = new E
-rror
+ngraved
 Label();
@@ -2289,24 +2289,26 @@
 abel();%0A    
+  
 myTextLabel.
@@ -2310,30 +2310,164 @@
 abel.set
-Opaque(true
+Font(myTextLabel.getFont().deriveFont(Font.BOLD));%0A      myTextLabel.setForeground(Gray._240);%0A    %7D else %7B%0A      myTextLabel = new ErrorLabel(
 );%0A
+  
     myTe
@@ -2526,24 +2526,63 @@
  1, 1, 1));%0A
+    %7D%0A%0A    myTextLabel.setOpaque(true);
 %0A    return 
@@ -2731,16 +2731,83 @@
 uePanel(
+Registry.is(%22ide.new.project.settings%22) ? new BorderLayout(0, 0) : 
 new Bord

use engraved separator for new project settings