Revision 41e2f693
Added by Cherian Mathew over 9 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/ChangeAcceptedTaxonToSynonymHandler.java | ||
---|---|---|
34 | 34 |
import eu.etaxonomy.taxeditor.editor.Page; |
35 | 35 |
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput; |
36 | 36 |
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; |
37 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
37 | 38 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
38 | 39 |
import eu.etaxonomy.taxeditor.navigation.navigator.operation.ChangeAcceptedTaxonToSynonymOperation; |
39 | 40 |
import eu.etaxonomy.taxeditor.navigation.navigator.operation.DeleteOperation; |
... | ... | |
99 | 100 |
|
100 | 101 |
// check if taxon has no children |
101 | 102 |
if(((TaxonNode)oldAcceptedTaxonNode).getCountChildren() > 0) { |
102 |
EditorUtil.warningDialog("Prerequisite not met", this,
|
|
103 |
MessagingUtils.warningDialog("Prerequisite not met", this,
|
|
103 | 104 |
"The accepted taxon must not have any childen. You need to move all childen to " + |
104 | 105 |
"another taxon node in the TaxonNavigator before attempting to turn the accepted " + |
105 | 106 |
"taxon into a synonym."); |
... | ... | |
138 | 139 |
|
139 | 140 |
|
140 | 141 |
} catch (NotDefinedException e) { |
141 |
NavigationUtil.warn(getClass(), "Command name not set");
|
|
142 |
MessagingUtils.warn(getClass(), "Command name not set");
|
|
142 | 143 |
} |
143 | 144 |
} else{ |
144 | 145 |
if( MessageDialog.openConfirm(HandlerUtil.getActiveShell(event), "Moving to synonymy", "The operation move accepted taxon to synonymy is available only for a single taxon.")){ |
... | ... | |
168 | 169 |
} |
169 | 170 |
EditorUtil.openTaxonNode(newAcceptedTaxonNodeUuid); |
170 | 171 |
} catch (PartInitException e) { |
171 |
EditorUtil.error(this.getClass(), e);
|
|
172 |
MessagingUtils.error(this.getClass(), e);
|
|
172 | 173 |
throw new RuntimeException(e); |
173 | 174 |
} catch (Exception e) { |
174 |
EditorUtil.warningDialog("Could not create Taxon", this, e.getMessage());
|
|
175 |
MessagingUtils.warningDialog("Could not create Taxon", this, e.getMessage());
|
|
175 | 176 |
} |
176 | 177 |
} |
177 | 178 |
|
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