From b480b9eb7450b50dc2b52d1dc151a8012ceb863d Mon Sep 17 00:00:00 2001 From: Eugene Petrenko Date: Wed, 27 Nov 2019 18:49:49 +0100 Subject: [PATCH] IDEA-CR-55905 - resolving suggestions GitOrigin-RevId: 05f458946c76a692d4d71188ca1238e5df531139 --- .../openapi/roots/ui/configuration/JdkComboBox.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 6d393424ac3b..b649daa4c10e 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 @@ -122,6 +122,8 @@ public class JdkComboBox extends ComboBox { myCreationFilter = notSimpleJavaSdkType(creationFilter); myOnNewSdkAdded = emptyIfNull(onNewSdkAdded); + UIUtil.putClientProperty(this, ANIMATION_IN_RENDERER_ALLOWED, true); + setMinimumAndPreferredWidth(JBUI.scale(400)); setMaximumRowCount(30); setSwingPopup(false); @@ -134,12 +136,7 @@ public class JdkComboBox extends ComboBox { boolean selected, boolean hasFocus) { - //allow AnimationIcon show progress animation - UIUtil.putClientProperty(list, ANIMATION_IN_RENDERER_ALLOWED, true); - UIUtil.putClientProperty(JdkComboBox.this, ANIMATION_IN_RENDERER_ALLOWED, true); - SimpleColoredComponent component = (SimpleColoredComponent)super.getListCellRendererComponent(list, value, index, selected, hasFocus); - UIUtil.putClientProperty(component, ANIMATION_IN_RENDERER_ALLOWED, true); JPanel panel = new JPanel(new BorderLayout()) { @Override @@ -154,7 +151,7 @@ public class JdkComboBox extends ComboBox { //handle the selected item to show in the ComboBox, not in the popup if (index == -1) { if (myModel.myIsSdkDetectorInProgress && isPopupVisible()) { - JBLabel progressIcon = new JBLabel(new AnimatedIcon.Default()); + JBLabel progressIcon = new JBLabel(AnimatedIcon.Default.INSTANCE); UIUtil.putClientProperty(progressIcon, ANIMATION_IN_RENDERER_ALLOWED, true); panel.add(progressIcon, BorderLayout.EAST); } @@ -190,7 +187,7 @@ public class JdkComboBox extends ComboBox { append(str, SimpleTextAttributes.ERROR_ATTRIBUTES); } else if (value instanceof LoadingJdkComboBoxItem) { - setIcon(new AnimatedIcon.Default()); + setIcon(AnimatedIcon.Default.INSTANCE); append(ProjectBundle.message("jdk.combo.box.search.of.sdks") ); } else if (value instanceof ProjectJdkComboBoxItem) {