Run configurations UI: limit combobox sizes for very long Python SDK paths

This commit is contained in:
Gregory.Shrago
2016-03-23 00:21:50 +03:00
parent d4e7c1446c
commit fa984dbfae
3 changed files with 5 additions and 4 deletions
@@ -103,7 +103,7 @@ public class JrePathEditor extends JPanel implements PanelWithAnchor {
myComboBoxModel.add(new CustomJreItem(homePath));
}
}
ComboBox comboBox = new ComboBox(myComboBoxModel);
ComboBox comboBox = new ComboBox(myComboBoxModel, 100);
comboBox.setEditable(true);
comboBox.setRenderer(new ColoredListCellRendererWrapper<JreComboBoxItem>() {
@Override
@@ -89,7 +89,7 @@
<text resource-bundle="com/jetbrains/python/PyBundle" key="runcfg.labels.interpreter"/>
</properties>
</component>
<component id="fc9a3" class="javax.swing.JComboBox" binding="myInterpreterComboBox" default-binding="true">
<component id="3f9aa" class="com.intellij.openapi.ui.ComboBox" binding="myInterpreterComboBox" default-binding="true">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
@@ -21,13 +21,13 @@ import com.intellij.execution.util.PathMappingsComponent;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectRootManager;
import com.intellij.openapi.roots.ui.configuration.ModulesAlphaComparator;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.ui.CollectionComboBoxModel;
@@ -57,7 +57,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
private TextFieldWithBrowseButton myWorkingDirectoryTextField;
private EnvironmentVariablesComponent myEnvsComponent;
private RawCommandLineEditor myInterpreterOptionsTextField;
private JComboBox myInterpreterComboBox;
private ComboBox myInterpreterComboBox;
private JRadioButton myUseModuleSdkRadioButton;
private ModulesComboBox myModuleComboBox;
private JPanel myMainPanel;
@@ -81,6 +81,7 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
myModuleComboBox.setModules(validModules);
myModuleComboBox.setSelectedModule(selection);
myInterpreterComboBox.setMinimumAndPreferredWidth(100);
myInterpreterComboBox.setRenderer(new SdkListCellRenderer("<Project Default>"));
myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(),
FileChooserDescriptorFactory.createSingleFolderDescriptor());