Revision 41e2f693
Added by Cherian Mathew over 9 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java | ||
---|---|---|
34 | 34 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
35 | 35 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
36 | 36 |
import eu.etaxonomy.taxeditor.model.DataChangeBridge; |
37 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
37 | 38 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
38 | 39 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
39 | 40 |
|
... | ... | |
90 | 91 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, null); |
91 | 92 |
|
92 | 93 |
if(taxonNode == null){ |
93 |
EditorUtil.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
|
|
94 |
MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
|
|
94 | 95 |
return null; |
95 | 96 |
} |
96 | 97 |
|
... | ... | |
111 | 112 |
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).find(taxonBaseUuid); |
112 | 113 |
if (taxonBase != null){ |
113 | 114 |
if(taxonBase.isOrphaned()) { |
114 |
EditorUtil.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
|
|
115 |
MessagingUtils.warningDialog("Orphaned Taxon", TaxonEditorInput.class, "This is an orphaned taxon i.e. a taxon that is not connected to a classification and not having any taxonomic relationships. Editing of orphaned taxon is currently not supported.");
|
|
115 | 116 |
} |
116 | 117 |
else if(taxonBase.isInstanceOf(Taxon.class)){ |
117 | 118 |
Taxon taxon = CdmBase.deproxy(taxonBase, Taxon.class); |
118 | 119 |
|
119 | 120 |
if (taxon.getTaxonNodes().size() == 0 && taxon.isMisapplication()){ |
120 | 121 |
// TODO get accepted taxon |
121 |
EditorUtil.info("trying to open Mispplied Name ");
|
|
122 |
MessagingUtils.info("trying to open Mispplied Name ");
|
|
122 | 123 |
|
123 | 124 |
Set<Taxon> acceptedTaxa = new HashSet<Taxon>(); |
124 | 125 |
Set<TaxonRelationship> relations = taxon.getRelationsFromThisTaxon(); |
... | ... | |
158 | 159 |
} |
159 | 160 |
}else if(taxonNodes.size() == 0){ |
160 | 161 |
// this is an undesired state |
161 |
EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
|
|
162 |
MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "The accepted taxon is not part of any classification. This should not have happened.");
|
|
162 | 163 |
} |
163 | 164 |
return null; |
164 | 165 |
} |
... | ... | |
176 | 177 |
return getInputForMultipleNodes(conversation, taxonNodes); |
177 | 178 |
}else if(taxa.size() == 0){ |
178 | 179 |
// this is an undesired state |
179 |
EditorUtil.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
|
|
180 |
MessagingUtils.warningDialog("Incorrect state", TaxonEditorInput.class, "Trying to open accepted taxon for a synonym or misapplication but" +
|
|
180 | 181 |
" no accepted taxa are present. This should not have happened."); |
181 | 182 |
} |
182 | 183 |
return null; |
Also available in: Unified diff
Moved all logging and dialog functionality to the new class MessagingUtils.
Refactoring code to adapt to above change.
Added new custom error dialog - CdmErrorDialog
Added runtime exception handling to the ApplicationWorkbenchAdvisor by adding a custom status handler