01: package net.refractions.udig.internal.ui;
02:
03: import net.refractions.udig.ui.internal.Messages;
04:
05: import org.eclipse.jface.dialogs.IDialogConstants;
06: import org.eclipse.jface.dialogs.IconAndMessageDialog;
07: import org.eclipse.swt.SWT;
08: import org.eclipse.swt.graphics.Image;
09: import org.eclipse.swt.layout.GridLayout;
10: import org.eclipse.swt.widgets.Composite;
11: import org.eclipse.swt.widgets.Control;
12: import org.eclipse.swt.widgets.Display;
13: import org.eclipse.swt.widgets.Shell;
14:
15: public class JaiErrorDialog extends IconAndMessageDialog {
16:
17: public JaiErrorDialog(Shell parentShell) {
18: super (parentShell);
19: setShellStyle(getShellStyle() | SWT.RESIZE);
20: }
21:
22: @Override
23: protected Control createDialogArea(Composite parent) {
24: message = Messages.UDIGApplication_error_jai_warning_text;
25: System.out.println("MESSAGES : " + message); //$NON-NLS-1$
26:
27: Composite composite = (Composite) super
28: .createDialogArea(parent);
29: ((GridLayout) composite.getLayout()).numColumns = 2;
30: ((GridLayout) composite.getLayout()).makeColumnsEqualWidth = false;
31:
32: createMessageArea(composite);
33:
34: return composite;
35: }
36:
37: protected void createButtonsForButtonBar(Composite parent) {
38: createButton(parent, IDialogConstants.OK_ID,
39: IDialogConstants.OK_LABEL, true);
40: }
41:
42: @Override
43: protected Image getImage() {
44: return getWarningImage();
45: }
46:
47: protected void configureShell(Shell newShell) {
48: newShell
49: .setText(Messages.UDIGApplication_error_jai_warning_title);
50: newShell.setImage(UiPlugin.getDefault()
51: .create("icon32.gif").createImage()); //$NON-NLS-1$
52: }
53:
54: public static void display() {
55: JaiErrorDialog dialog = new JaiErrorDialog(Display.getCurrent()
56: .getActiveShell());
57: dialog.open();
58: }
59:
60: }
|