--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.model;
+
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * @author k.luther
+ * @date Oct 7, 2015
+ *
+ */
+public class CdmDeleteErrorDialog extends ErrorDialog {
+
+
+ private static final int DIALOG_MAX_HEIGHT = 500;
+
+ private final String stackTrace;
+
+
+
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param message
+ * @param status
+ * @param stackTrace
+ */
+ public CdmDeleteErrorDialog(Shell parentShell,
+ String dialogTitle,
+ String message,
+ IStatus status,
+ String stackTrace,
+ Object[] updatedObjects) {
+ super(parentShell,
+ dialogTitle,
+ message, status,
+ IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
+ this.stackTrace = stackTrace;
+ this.message = message == null ? status.getMessage()
+ : message + "\n " + status.getMessage(); //$NON-NLS-1$
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
+ */
+ @Override
+ protected void buttonPressed(int id) {
+ super.buttonPressed(id);
+ if (id == IDialogConstants.DETAILS_ID) {
+ Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ // set height to max allowed
+ if(getShell().getSize().y > DIALOG_MAX_HEIGHT) {
+ getShell().setSize(getShell().getSize().x, 500);
+ } else {
+ getShell().setSize(getShell().getSize().x, oldSize.y);
+ }
+ }
+
+ }
+
+
+
+
+
+
+
+
+
+}