IDEA-246340 Broken Gradle settings layout when there are several linked Gradle projects
authorVladislav.Soroka <Vladislav.Soroka@jetbrains.com>
Thu, 13 Aug 2020 16:22:16 +0000 (19:22 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 13 Aug 2020 16:25:28 +0000 (16:25 +0000)
GitOrigin-RevId: 14e705b411242a72358b7e9dfead143e558460d7

plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/IdeaGradleProjectSettingsControlBuilder.java

index b442ca2645be34b9ccdf6a4d0b3cc1cfdea5a0c7..d23864e4d5a2d452423d67295c3f250c95aa4729 100644 (file)
@@ -102,6 +102,8 @@ public class IdeaGradleProjectSettingsControlBuilder implements GradleProjectSet
   private boolean myShowBalloonIfNecessary;
   @Nullable
   private TextFieldWithBrowseButton myGradleHomePathField;
+  @SuppressWarnings({"unused", "RedundantSuppression"}) // used by ExternalSystemUiUtil.showUi to show/hide the component via reflection
+  private JPanel myGradlePanel;
   @Nullable
   private JLabel myGradleJdkLabel;
   @Nullable
@@ -112,6 +114,8 @@ public class IdeaGradleProjectSettingsControlBuilder implements GradleProjectSet
   private boolean dropCustomizableWrapperButton;
   private boolean dropUseLocalDistributionButton;
   private boolean dropUseBundledDistributionButton;
+  @SuppressWarnings({"unused", "RedundantSuppression"}) // used by ExternalSystemUiUtil.showUi to show/hide the component via reflection
+  private JPanel myImportPanel;
   private JPanel myModulePerSourceSetPanel;
   @Nullable
   private JBCheckBox myResolveModulePerSourceSetCheckBox;
@@ -260,7 +264,7 @@ public class IdeaGradleProjectSettingsControlBuilder implements GradleProjectSet
   }
 
   private void addImportComponents(PaintAwarePanel content, int indentLevel) {
-    addComponentsGroup(null, content, indentLevel, panel -> {
+    myImportPanel = addComponentsGroup(null, content, indentLevel, panel -> {
       if (!dropResolveModulePerSourceSetCheckBox) {
         myModulePerSourceSetPanel = new JPanel(new GridBagLayout());
         panel.add(myModulePerSourceSetPanel, ExternalSystemUiUtil.getFillLineConstraints(0).insets(0, 0, 0, 0));
@@ -315,7 +319,7 @@ public class IdeaGradleProjectSettingsControlBuilder implements GradleProjectSet
   }
 
   private void addGradleComponents(PaintAwarePanel content, int indentLevel) {
-    addComponentsGroup("Gradle", content, indentLevel, panel -> {
+    myGradlePanel = addComponentsGroup("Gradle", content, indentLevel, panel -> {
       addGradleChooserComponents(panel, indentLevel + 1);
       addGradleJdkComponents(panel, indentLevel + 1);
     });