From 014bb16e622828144557fc71f3565239ec2afd6e Mon Sep 17 00:00:00 2001 From: Pavel Dolgov Date: Tue, 17 Apr 2018 16:51:12 +0300 Subject: [PATCH] Java: Cosmetic UI improvements in Extract Method preview (IDEA-190179) --- .../extractMethod/ExtractMethodDialog.java | 14 ++++++++++---- .../src/messages/RefactoringBundle.properties | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java index 1e8b5eca90de..da64381c5d92 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java @@ -505,16 +505,22 @@ public class ExtractMethodDialog extends RefactoringDialog implements AbstractEx ApplicationManager.getApplication().invokeLater( () -> { if (count != 0) { - duplicatesCount.setIcon(UIUtil.getBalloonInformationIcon()); - duplicatesCount.setText(RefactoringBundle.message("refactoring.extract.method.dialog.duplicates.count", count)); + showCount(UIUtil.getBalloonInformationIcon(), + " " + RefactoringBundle.message("refactoring.extract.method.dialog.duplicates.count", count), + JBUI.Borders.empty(18, 0)); } else { - duplicatesCount.setIcon(null); - duplicatesCount.setText(""); + showCount(null, "", null); } }, ModalityState.any()); } + + private void showCount(Icon icon, String message, Border border) { + duplicatesCount.setIcon(icon); + duplicatesCount.setText(message); + duplicatesCount.setBorder(border); + } }); } return duplicatesCount; diff --git a/platform/platform-resources-en/src/messages/RefactoringBundle.properties b/platform/platform-resources-en/src/messages/RefactoringBundle.properties index 011bc85748b2..04ac79306966 100644 --- a/platform/platform-resources-en/src/messages/RefactoringBundle.properties +++ b/platform/platform-resources-en/src/messages/RefactoringBundle.properties @@ -801,7 +801,7 @@ refactoring.extract.method.preview.command=Extracting method refactoring.extract.method.preview.group.method=Method to extract refactoring.extract.method.preview.group.original=Original code fragment refactoring.extract.method.preview.group.duplicates=Duplicate code fragments -refactoring.extract.method.preview.button.refactor=&Refactor +refactoring.extract.method.preview.button.refactor=Do &Refactor refactoring.extract.method.preview.button.rerun=R&erun Refactoring refactoring.extract.method.preview.button.cancel=&Cancel