From fae615a4702d0db7efc8e5120148370abc489fff Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Sun, 22 Feb 2015 13:46:14 +0300 Subject: [PATCH] Show "Optional actions" label only if there are any (IDEA-136830) --- .../src/com/intellij/codeInsight/actions/LayoutCodeDialog.form | 2 +- .../src/com/intellij/codeInsight/actions/LayoutCodeDialog.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.form b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.form index b6e07f4c8a5b..3c6a16512e86 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.form +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.form @@ -107,7 +107,7 @@ - + diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java index 6dc2971b800c..cd0a9c0890f2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/LayoutCodeDialog.java @@ -51,6 +51,7 @@ public class LayoutCodeDialog extends DialogWrapper { private JPanel myActionsPanel; private JPanel myScopePanel; + private JLabel myOptionalLabel; private LayoutCodeOptions myRunOptions; @@ -127,6 +128,8 @@ public class LayoutCodeDialog extends DialogWrapper { if (canRearrangeCode) { myRearrangeCodeCb.setSelected(myLastRunOptions.isRearrangeCode(myFile.getLanguage())); } + + myOptionalLabel.setVisible(canOptimizeImports || canRearrangeCode); } @Nullable