1 package eu
.etaxonomy
.taxeditor
.model
;
3 import org
.eclipse
.core
.runtime
.IStatus
;
4 import org
.eclipse
.jface
.dialogs
.ErrorDialog
;
5 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
6 import org
.eclipse
.jface
.resource
.JFaceResources
;
7 import org
.eclipse
.swt
.SWT
;
8 import org
.eclipse
.swt
.graphics
.Point
;
9 import org
.eclipse
.swt
.widgets
.Composite
;
10 import org
.eclipse
.swt
.widgets
.List
;
11 import org
.eclipse
.swt
.widgets
.Shell
;
14 * Error dialog class specifically implemented for the editor.
15 * The main difference with {@link org.eclipse.jface.dialogs.ErrorDialog} is that
16 * this dialog has a fixed max height.
21 public class CdmErrorDialog
extends ErrorDialog
{
23 private static final int DIALOG_MAX_HEIGHT
= 500;
25 public CdmErrorDialog(Shell parentShell
, String dialogTitle
,
26 String message
, IStatus status
) {
30 IStatus
.OK
| IStatus
.INFO
| IStatus
.WARNING
| IStatus
.ERROR
);
34 protected void buttonPressed(int id
) {
35 super.buttonPressed(id
);
36 if (id
== IDialogConstants
.DETAILS_ID
) {
37 Point oldSize
= getShell().computeSize(SWT
.DEFAULT
, SWT
.DEFAULT
);
38 // set height to max allowed
39 if(getShell().getSize().y
> DIALOG_MAX_HEIGHT
) {
40 getShell().setSize(getShell().getSize().x
, 500);
42 getShell().setSize(getShell().getSize().x
, oldSize
.y
);
49 protected List
createDropDownList(Composite parent
) {
50 List list
= super.createDropDownList(parent
);
51 list
.getMenu().getItem(0).setText(JFaceResources
.getString("copy all"));