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