diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/JdkChooserPanel.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/JdkChooserPanel.java index b84c24113911..3e50dd514de8 100644 --- a/java/idea-ui/src/com/intellij/ide/util/projectWizard/JdkChooserPanel.java +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/JdkChooserPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -60,8 +60,6 @@ public class JdkChooserPanel extends JPanel { myList = new JBList(myListModel); myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myList.setCellRenderer(new ProjectJdkListRenderer(myList.getCellRenderer())); - //noinspection HardCodedStringLiteral - myList.setPrototypeCellValue("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); myList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { diff --git a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkListRenderer.java b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkListRenderer.java index 011f6fa87e90..4eb42200851d 100644 --- a/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkListRenderer.java +++ b/java/idea-ui/src/com/intellij/ide/util/projectWizard/ProjectJdkListRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -34,7 +34,7 @@ public class ProjectJdkListRenderer extends HtmlListCellRenderer { @Override public void doCustomize(JList list, Object value, int index, boolean selected, boolean hasFocus) { if (value == null || value instanceof Sdk) { - OrderEntryAppearanceService.getInstance().forJdk((Sdk)value, false, selected, index != -1).customize(this); + OrderEntryAppearanceService.getInstance().forJdk((Sdk)value, false, selected, true).customize(this); } else { final String str = value.toString(); diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/JdkComboBox.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/JdkComboBox.java index aae24ea21e63..2684628f6e89 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/JdkComboBox.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/JdkComboBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -71,20 +71,21 @@ public class JdkComboBox extends ComboBoxWithWidePopup { final String str = value.toString(); append(str, SimpleTextAttributes.ERROR_ATTRIBUTES); } - else if (value instanceof ProjectJdkComboBoxItem){ + else if (value instanceof ProjectJdkComboBoxItem) { final Sdk jdk = jdkModel.getProjectSdk(); - if (jdk != null){ + if (jdk != null) { setIcon(jdk.getSdkType().getIcon()); append(ProjectBundle.message("project.roots.project.jdk.inherited"), SimpleTextAttributes.REGULAR_ATTRIBUTES); append(" (" + jdk.getName() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES); - } else { + } + else { final String str = value.toString(); append(str, SimpleTextAttributes.ERROR_ATTRIBUTES); } } else { - super.doCustomize(list, value != null ? ((JdkComboBoxItem)value).getJdk() : new NoneJdkComboBoxItem(), index, selected, - hasFocus); + super.doCustomize(list, value != null ? ((JdkComboBoxItem)value).getJdk() + : new NoneJdkComboBoxItem(), index, selected, hasFocus); } } }