3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.model
;
13 import org
.eclipse
.core
.runtime
.IStatus
;
14 import org
.eclipse
.jface
.dialogs
.ErrorDialog
;
15 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
16 import org
.eclipse
.swt
.SWT
;
17 import org
.eclipse
.swt
.graphics
.Point
;
18 import org
.eclipse
.swt
.widgets
.Shell
;
26 public class CdmDeleteErrorDialog
extends ErrorDialog
{
29 private static final int DIALOG_MAX_HEIGHT
= 500;
31 private final String stackTrace
;
42 public CdmDeleteErrorDialog(Shell parentShell
,
47 Object
[] updatedObjects
) {
51 IStatus
.OK
| IStatus
.INFO
| IStatus
.WARNING
| IStatus
.ERROR
);
52 this.stackTrace
= stackTrace
;
53 this.message
= message
== null ? status
.getMessage()
54 : message
+ "\n " + status
.getMessage(); //$NON-NLS-1$
59 * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
62 protected void buttonPressed(int id
) {
63 super.buttonPressed(id
);
64 if (id
== IDialogConstants
.DETAILS_ID
) {
65 Point oldSize
= getShell().computeSize(SWT
.DEFAULT
, SWT
.DEFAULT
);
66 // set height to max allowed
67 if(getShell().getSize().y
> DIALOG_MAX_HEIGHT
) {
68 getShell().setSize(getShell().getSize().x
, 500);
70 getShell().setSize(getShell().getSize().x
, oldSize
.y
);