Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down