better control size management in fatal error dialog (IDEA-120304, IDEA-116542)

This commit is contained in:
peter
2014-02-13 16:42:55 +01:00
parent c8fb420148
commit 8a99a3e32b
3 changed files with 35 additions and 21 deletions
@@ -10,25 +10,27 @@
<size top="5" left="5" bottom="5" right="5"/>
</border>
<children>
<component id="c3482" class="com.intellij.openapi.ui.LabeledComponent" binding="myErrorComponent">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="1" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<componentClass value="javax.swing.JTextArea"/>
<text value="&amp;Error message"/>
</properties>
</component>
<vspacer id="9872d">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<nested-form id="c37ed" form-file="com/intellij/diagnostic/errordialog/LabeledTextComponent.form" binding="myCommentsArea">
<grid id="cdd81" binding="myErrorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
<grid id="8e8fc" binding="myCommentsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
</nested-form>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>
@@ -1,13 +1,10 @@
package com.intellij.diagnostic.errordialog;
import com.intellij.diagnostic.DiagnosticBundle;
import com.intellij.diagnostic.IdeErrorsDialog;
import com.intellij.openapi.ui.LabeledComponent;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.util.ui.UIUtil;
import javax.swing.*;
import java.awt.*;
/**
* @author ksafonov
@@ -15,14 +12,28 @@ import java.awt.*;
public class CommentsTabForm {
private LabeledTextComponent myCommentsArea;
private JPanel myContentPane;
private LabeledComponent<JTextArea> myErrorComponent;
private LabeledTextComponent myErrorComponent;
private JPanel myErrorPanel;
private JPanel myCommentsPanel;
public CommentsTabForm() {
myErrorComponent = new LabeledTextComponent();
myErrorComponent.setTitle(DiagnosticBundle.message("error.dialog.error.prompt"));
myCommentsArea = new LabeledTextComponent();
myCommentsArea.setTitle(DiagnosticBundle.message("error.dialog.comment.prompt"));
myErrorComponent.getComponent().setPreferredSize(new Dimension(IdeErrorsDialog.COMPONENTS_WIDTH, -1));
myErrorComponent.getComponent().setEditable(false);
myErrorComponent.getComponent().setBackground(UIUtil.getTextFieldBackground());
myErrorComponent.getComponent().setBorder(IdeBorderFactory.createBorder());
JTextArea errorArea = myErrorComponent.getTextComponent();
//errorArea.setPreferredSize(new Dimension(IdeErrorsDialog.COMPONENTS_WIDTH, -1));
errorArea.setLineWrap(true);
errorArea.setEditable(false);
errorArea.setBackground(UIUtil.getTextFieldBackground());
errorArea.setBorder(IdeBorderFactory.createBorder());
myCommentsArea.getTextComponent().setLineWrap(true);
myErrorPanel.add(myErrorComponent.getContentPane());
myCommentsPanel.add(myCommentsArea.getContentPane());
}
public JPanel getContentPane() {
@@ -30,8 +41,8 @@ public class CommentsTabForm {
}
public void setErrorText(String s) {
myErrorComponent.getComponent().setText(s);
myErrorComponent.getComponent().setCaretPosition(0);
myErrorComponent.getTextComponent().setText(s);
myErrorComponent.getTextComponent().setCaretPosition(0);
}
public void setCommentText(String s) {
@@ -71,6 +71,7 @@ title.submitting.error.report=Submitting error report
log.console.filter.show.errors.warnings.and.infos=infos
log.console.filter.show.prefix=Log level:
error.comments.tab.title=Comments
error.dialog.error.prompt=&Error message
error.dialog.comment.prompt=<html><u>P</u>lease fill in any details that may be important: steps to reproduce, what were you doing when problem occurred, etc.:</html>
error.details.tab.title=Details
error.dialog.disable.plugin.prompt.dependants=<html>Are you sure you would like to disable plugin <b>{0}</b>?<br/>Functionality provided by the plugin and dependent plugins will no longer be available.</html>