mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
There's enough room for SDK version
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user