From 35af155f74d59ed90bf3fceef7443bd619db293e Mon Sep 17 00:00:00 2001 From: "Kirill.Likhodedov" Date: Sat, 9 Nov 2013 18:11:56 +0400 Subject: [PATCH] Don't display empty panel if there are no moreMessage in the dialog --- .../src/com/intellij/openapi/ui/Messages.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/platform-api/src/com/intellij/openapi/ui/Messages.java b/platform/platform-api/src/com/intellij/openapi/ui/Messages.java index a23ac12c6795..fb21fe234a5e 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/Messages.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/Messages.java @@ -182,7 +182,7 @@ public class Messages { public static int showDialog(Project project, String message, @NotNull String title, - String moreInfo, + @Nullable String moreInfo, @NotNull String[] options, int defaultOptionIndex, int focusedOptionIndex, @@ -1055,12 +1055,12 @@ public class Messages { } private static class MoreInfoMessageDialog extends MessageDialog { - private final String myInfoText; + @Nullable private final String myInfoText; public MoreInfoMessageDialog(Project project, String message, String title, - String moreInfo, + @Nullable String moreInfo, @NotNull String[] options, int defaultOptionIndex, int focusedOptionIndex, Icon icon) { super(project); @@ -1075,6 +1075,9 @@ public class Messages { @Override protected JComponent createCenterPanel() { + if (myInfoText == null) { + return null; + } final JPanel panel = new JPanel(new BorderLayout()); final JTextArea area = new JTextArea(myInfoText); area.setEditable(false);