Project

General

Profile

« Previous | Next » 

Revision 6a534f27

Added by Katja Luther over 5 years ago

add button to select default source in distribution editor

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/DeleteTermBaseOperation.java
28 28
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
29 29
import eu.etaxonomy.taxeditor.store.CdmStore;
30 30
import eu.etaxonomy.taxeditor.store.StoreUtil;
31
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
31 32

  
32 33
/**
33 34
 * @author l.morris
......
69 70

  
70 71
			DeleteResult result =	CdmStore.getService(IVocabularyService.class).delete(termBase.getUuid());
71 72
			if (!result.isOk()){
72
				StringBuffer errorString = new StringBuffer();
73
				for (Exception e:result.getExceptions()){
74
					errorString.append(e.getMessage() + System.lineSeparator());
75
				}
76
				MessageDialog.openWarning(null, "Delete failed", errorString.toString());
77
			}
73
                StringBuffer errorString = new StringBuffer();
74
                for (Exception e:result.getExceptions()){
75
                    errorString.append(e.getMessage() + System.lineSeparator());
76
                }
77
                if (result.isAbort()){
78
                    MessageDialog.openWarning(null, "Delete failed", errorString.toString());
79
                }else{
80
                    if (result.getExceptions().iterator().hasNext()){
81
                        MessagingUtils.errorDialog("Delete failed", this.getClass(),null, TaxeditorStorePlugin.PLUGIN_ID, result.getExceptions().iterator().next(), true);
82
                    }else{
83
                        MessageDialog.openWarning(null, "Delete failed", errorString.toString());
84
                    }
85
                }
86
            }
78 87

  
79 88
		} else if (termBase instanceof DefinedTermBase) {
80 89

  
......
99 108
                for (Exception e:result.getExceptions()){
100 109
                    errorString.append(e.getMessage() + System.lineSeparator());
101 110
                }
102
                MessageDialog.openWarning(null, "Delete failed", errorString.toString());
111
                if (result.isAbort()){
112
                    MessageDialog.openWarning(null, "Delete failed", errorString.toString());
113
                }else{
114
                    if (result.getExceptions().iterator().hasNext()){
115
                        MessagingUtils.errorDialog("Delete failed", this.getClass(),null, TaxeditorStorePlugin.PLUGIN_ID, result.getExceptions().iterator().next(), true);
116
                    }else{
117
                        MessageDialog.openWarning(null, "Delete failed", errorString.toString());
118
                    }
119
                }
103 120
            }
104 121
		}
105 122

  

Also available in: Unified diff