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
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
15 import org
.eclipse
.core
.runtime
.IStatus
;
16 import org
.eclipse
.core
.runtime
.Status
;
18 import eu
.etaxonomy
.cdm
.api
.service
.DeleteResult
;
25 public class DeleteResultMessagingUtils
extends MessagingUtils
{
27 * Displays a message {@link org.eclipse.jface.dialogs.MessageDialog}.
33 public static void messageDialogWithDetails(DeleteResult result
, String message
, String pluginId
) {
34 if (result
.isOk() && result
.getExceptions().isEmpty()){
37 List
<String
> details
= new ArrayList
<String
>();
40 if (result
.isOk() && result
.getExceptions().size() > 0){
41 for (Exception e
:result
.getExceptions()){
42 details
.add(e
.getMessage());
44 title
= "The delete was successfull.";
46 String stackTraceWithContext
= getContextInfo(details
);
47 CdmErrorDialog ced
= new CdmErrorDialog(AbstractUtility
.getShell(), title
, message
, new Status(IStatus
.ERROR
, pluginId
, null), stackTraceWithContext
);