From e9adeee0f908de3b573ba6fa3486a8fa5d6bb629 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 1 May 2018 14:13:16 +0300 Subject: [PATCH] [ui] reduces text duplication in exception dialog (IDEA-190797) --- .../intellij/diagnostic/IdeErrorsDialog.java | 42 +++++++++++++------ .../src/messages/DiagnosticBundle.properties | 1 + 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java index 3d3e4227740b..80b0d43378af 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java @@ -272,7 +272,7 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene myNoticeArea.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE); JPanel decoratorPanel = new JPanel(new BorderLayout()); - myNoticeDecorator = new HideableDecorator(decoratorPanel, DiagnosticBundle.message("error.dialog.notice.label"), false); + myNoticeDecorator = new NoticeDecorator(decoratorPanel); myNoticeDecorator.setContentComponent(myNoticeArea); JPanel commentPanel = new JPanel(new BorderLayout()); @@ -631,17 +631,6 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene /* UI components */ - private static class AttachmentsList extends CheckBoxList { - private void addItem(String item, boolean selected) { - super.addItem(item, item + " ", selected); - } - - @Override - protected boolean isEnabled(int index) { - return index > 0; - } - } - private class BackAction extends AnAction implements DumbAware { public BackAction() { super("Previous", null, AllIcons.Actions.Back); @@ -714,6 +703,35 @@ public class IdeErrorsDialog extends DialogWrapper implements MessagePoolListene } } + private static class AttachmentsList extends CheckBoxList { + private void addItem(String item, boolean selected) { + super.addItem(item, item + " ", selected); + } + + @Override + protected boolean isEnabled(int index) { + return index > 0; + } + } + + private static class NoticeDecorator extends HideableDecorator { + private NoticeDecorator(JPanel panel) { + super(panel, "...", false); + } + + @Override + protected void on() { + super.on(); + setTitle(DiagnosticBundle.message("error.dialog.notice.label.expanded")); + } + + @Override + protected void off() { + super.off(); + setTitle(DiagnosticBundle.message("error.dialog.notice.label")); + } + } + /* interfaces */ @Override diff --git a/platform/platform-resources-en/src/messages/DiagnosticBundle.properties b/platform/platform-resources-en/src/messages/DiagnosticBundle.properties index 172833f359d6..c33c5a2a1bbc 100644 --- a/platform/platform-resources-en/src/messages/DiagnosticBundle.properties +++ b/platform/platform-resources-en/src/messages/DiagnosticBundle.properties @@ -33,6 +33,7 @@ error.dialog.foreign.plugin.warning.vendor=This plugin is not a production error.dialog.comment.prompt=Please fill in any details that may be important (steps to reproduce, what were you doing when the exception occurred, etc.): error.dialog.attachments.prompt=Please review the data included in this exception report: error.dialog.notice.label=By submitting this report, you agree to the terms and conditions of the privacy policy +error.dialog.notice.label.expanded=Privacy policy error.dialog.submit.anonymous=Submit anonymously or use JetBrains Account error.dialog.submit.named=Submit as {0} or change account error.report.to.jetbrains.action=&Report to JetBrains