From: Katja Luther Date: Thu, 11 Apr 2019 08:49:04 +0000 (+0200) Subject: ref #8223: check success before try to open new taxon X-Git-Tag: 5.6.0^2~9 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/d446db0496d91e9007408ca77d5510a547c8aa24 ref #8223: check success before try to open new taxon --- diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java index c3a27ff4b..780af1a51 100644 --- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java +++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/NewTaxonNodeHandlerE4.java @@ -56,7 +56,7 @@ public class NewTaxonNodeHandlerE4 { }); int status = dialog.open(); - if(status == IStatus.OK && wizard.openInEditor()){ + if(status == IStatus.OK && wizard.openInEditor() && wizard.isSuccess()){ EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, true); if(wizard.openEmpty()){ EditorUtil.openEmptyE4(wizard.getParentTreeNode().getUuid()); diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java index 553438bae..e8125dd97 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java @@ -40,6 +40,7 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard{ private UUID generatedTaxonNodeUuid; private IWizardPageListener wizardPageListener; private boolean isOpenInEditor = false; + private boolean success = true; /** *

Constructor for AbstractNewEntityWizard.

@@ -83,12 +84,14 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard{ .fireChangeEvent(new CdmChangeEvent(Action.Create, result.getUpdatedObjects(), NewTaxonNodeWizard.class), true); }else{ + setSuccess(false); if (!result.isOk()){ if (!result.getExceptions().isEmpty()){ MessagingUtils.error(getClass(), "Taxon could not be created", result.getExceptions().iterator().next()); }else{ MessagingUtils.warn(getClass(), "Taxon could not be created"); } + } } }catch(IllegalArgumentException e){ @@ -167,5 +170,15 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard{ } + public boolean isSuccess() { + return success; + } + + + public void setSuccess(boolean success) { + this.success = success; + } + + }