Revision e29e2ebd
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/DeleteResultMessagingUtils.java | ||
---|---|---|
14 | 14 |
import java.util.List; |
15 | 15 |
|
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 |
import org.eclipse.core.runtime.MultiStatus; |
|
17 | 18 |
import org.eclipse.core.runtime.Status; |
18 | 19 |
|
19 | 20 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
... | ... | |
80 | 81 |
|
81 | 82 |
|
82 | 83 |
} |
84 |
|
|
85 |
public static void messageDialogWithDetails(IStatus result, String message, String pluginId) { |
|
86 |
|
|
87 |
List<String> details = new ArrayList<String>(); |
|
88 |
String title= ""; |
|
89 |
Throwable e = null; |
|
90 |
if (result.isMultiStatus()){ |
|
91 |
for (IStatus childStatus:result.getChildren()){ |
|
92 |
details.add(childStatus.getMessage()); |
|
93 |
} |
|
94 |
e = result.getChildren()[0].getException(); |
|
95 |
if (result.equals(Status.OK_STATUS)|| result.equals(Status.WARNING)){ |
|
96 |
title = "Delete was successfull."; |
|
97 |
} else { |
|
98 |
title = "Delete was aborted."; |
|
99 |
} |
|
100 |
} |
|
101 |
StringBuffer relatedObjectsString = new StringBuffer(); |
|
102 |
Object[] relatedObjects = new ArrayList<Object>().toArray(); |
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
String stackTraceWithContext = getContextInfo(details); |
|
107 |
CdmDeleteErrorDialog ced = new CdmDeleteErrorDialog(AbstractUtility.getShell(), title, message,new Status(IStatus.INFO, pluginId, null, e), stackTraceWithContext, relatedObjects); |
|
108 |
|
|
109 |
ced.open(); |
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
} |
|
114 |
|
|
83 | 115 |
} |
Also available in: Unified diff
smaller changes for specimen import and others