diff --git a/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertDialog.java b/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertDialog.java index fd1f17768..eb8778517 100644 --- a/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertDialog.java +++ b/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertDialog.java @@ -50,6 +50,7 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -68,6 +69,9 @@ import org.openjdk.jmc.ui.misc.TypedLabelProvider; public class AlertDialog extends TitleAreaDialog { + // Minimum alert dialog height (in dialog units) + public static final int MIN_ALERT_DIALOG_HEIGHT = 200; + private Button m_clearButton; private Text m_text; private TableViewer m_viewer; @@ -194,6 +198,12 @@ protected Control createContents(Composite parent) { return contents; } + @Override + protected Point getInitialSize() { + Point shellSize = super.getInitialSize(); + return new Point(shellSize.x, Math.max(convertVerticalDLUsToPixels(MIN_ALERT_DIALOG_HEIGHT), shellSize.y)); + } + @Override protected Control createDialogArea(Composite parent) { Control dialogArea = super.createDialogArea(parent); @@ -203,7 +213,7 @@ protected Control createDialogArea(Composite parent) { viewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); m_text = createMessage(sash); m_text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); - sash.setWeights(new int[] {75, 25}); + sash.setWeights(new int[] {60, 40}); sash.setLayout(new GridLayout()); return dialogArea; } diff --git a/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertPlugin.java b/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertPlugin.java index 1c975e246..73b0bd672 100644 --- a/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertPlugin.java +++ b/application/org.openjdk.jmc.alert/src/main/java/org/openjdk/jmc/alert/AlertPlugin.java @@ -148,12 +148,12 @@ private String createExceptionMessage(Date d, Throwable exception, TriggerRule r new Object[] {df1.format(d), df2.format(d)})); } builder.append(NLS.bind(Messages.AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION, rule.getName())); - if (triggerMessage != null) { - builder.append("\n" + triggerMessage + "\n"); - } builder.append(NLS.bind(Messages.AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_CAPTION, exception.getLocalizedMessage())); builder.append(Messages.AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_MORE_INFORMATION); + if (triggerMessage != null) { + builder.append("\n" + triggerMessage); + } return builder.toString(); } diff --git a/application/org.openjdk.jmc.alert/src/main/resources/org/openjdk/jmc/alert/messages.properties b/application/org.openjdk.jmc.alert/src/main/resources/org/openjdk/jmc/alert/messages.properties index e65de161f..b1e5a10e4 100644 --- a/application/org.openjdk.jmc.alert/src/main/resources/org/openjdk/jmc/alert/messages.properties +++ b/application/org.openjdk.jmc.alert/src/main/resources/org/openjdk/jmc/alert/messages.properties @@ -38,8 +38,8 @@ AlertDialog_CLEAR_ALERTS_TEXT0=Clear AlertDialog_COLUMN_HEADER_SOURCE=Source AlertDialog_POP_UP_ON_ALERTS_TEXT=Show dialog on alerts AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION=An exception occurred when invoking the action for the rule {0}!\n -AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_CAPTION=The message was: {0}\n\n -AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_MORE_INFORMATION=For more information, please see the log! +AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_CAPTION=The message was: {0}\n +AlertPlugin_MESSAGE_EXCEPTION_INVOKING_ACTION_MESSAGE_MORE_INFORMATION=For more information, please see the log!\n AlertPlugin_RULE_X_Y_TEXT=Rule: {0}\\{1}\n AlertPlugin_SOURCE_X_TEXT=Source: {0}\n AlertPlugin_TIME_X_Y_TEXT=Time: {0} {1}\n