From fa984dbfaed3bd8d7924dfe6c62c1ae37bf1c15c Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Wed, 23 Mar 2016 00:18:12 +0300 Subject: [PATCH] Run configurations UI: limit combobox sizes for very long Python SDK paths --- .../impl/src/com/intellij/execution/ui/JrePathEditor.java | 2 +- .../com/jetbrains/python/run/PyPluginCommonOptionsForm.form | 2 +- .../com/jetbrains/python/run/PyPluginCommonOptionsForm.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/java/execution/impl/src/com/intellij/execution/ui/JrePathEditor.java b/java/execution/impl/src/com/intellij/execution/ui/JrePathEditor.java index 5c854964c827..5fabcc8809cd 100644 --- a/java/execution/impl/src/com/intellij/execution/ui/JrePathEditor.java +++ b/java/execution/impl/src/com/intellij/execution/ui/JrePathEditor.java @@ -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() { @Override diff --git a/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.form b/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.form index 0332fda9195b..b4fb87bc7948 100644 --- a/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.form +++ b/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.form @@ -89,7 +89,7 @@ - + diff --git a/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.java b/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.java index bd0fb418c5be..92caaf47fc61 100644 --- a/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.java +++ b/python/pluginCore/com/jetbrains/python/run/PyPluginCommonOptionsForm.java @@ -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("")); myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(), FileChooserDescriptorFactory.createSingleFolderDescriptor());