commit 2ffe661a7f2e2bda261adf9343a2bd94e9a23ffb
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Fri Apr 20 19:20:32 2018 +0200

    minor refactoring to clarify code

diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
index 4c76bbe7..4895dad2 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNameEditorPresenter.java
@@ -49,6 +49,7 @@ import eu.etaxonomy.cdm.vaadin.security.UserHelper;
 import eu.etaxonomy.cdm.vaadin.ui.RegistrationUIDefaults;
 import eu.etaxonomy.cdm.vaadin.util.CdmTitleCacheCaptionGenerator;
 import eu.etaxonomy.cdm.vaadin.view.reference.ReferencePopupEditor;
+import eu.etaxonomy.vaadin.component.ReloadableLazyComboBox;
 import eu.etaxonomy.vaadin.component.ReloadableSelect;
 import eu.etaxonomy.vaadin.mvp.AbstractCdmEditorPresenter;
 import eu.etaxonomy.vaadin.mvp.BeanInstantiator;
@@ -375,7 +376,7 @@ public class TaxonNameEditorPresenter extends AbstractCdmEditorPresenter<TaxonNa
             return;
         }
 
-        basionymSourceField = (AbstractField<TaxonName>)event.getSourceComponent();
+        basionymSourceField = (ReloadableLazyComboBox<TaxonName>)event.getSourceComponent();
 
         basionymNamePopup = getNavigationManager().showInPopup(TaxonNamePopupEditor.class, getView());
         basionymNamePopup.grantToCurrentUser(EnumSet.of(CRUD.UPDATE, CRUD.DELETE));
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
index 2ab8629a..b21b2d45 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/TaxonNamePopupEditor.java
@@ -45,6 +45,7 @@ import eu.etaxonomy.cdm.vaadin.security.AccessRestrictedView;
 import eu.etaxonomy.cdm.vaadin.security.UserHelper;
 import eu.etaxonomy.cdm.vaadin.util.TeamOrPersonBaseCaptionGenerator;
 import eu.etaxonomy.cdm.vaadin.util.converter.SetToListConverter;
+import eu.etaxonomy.vaadin.component.ReloadableLazyComboBox;
 import eu.etaxonomy.vaadin.component.SwitchableTextField;
 import eu.etaxonomy.vaadin.component.ToManyRelatedEntitiesComboboxSelect;
 import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
@@ -324,7 +325,8 @@ public class TaxonNamePopupEditor extends AbstractCdmPopupEditor<TaxonName, Taxo
                 beanUuid = ((CdmBase)fieldValue).getUuid();
 
             }
-            getViewEventBus().publish(this, new TaxonNameEditorAction(e.getAction(), beanUuid, e.getSource(), this));
+            ReloadableLazyComboBox<TaxonName>  lazyCombobox = (ReloadableLazyComboBox<TaxonName>) e.getSource();
+            getViewEventBus().publish(this, new TaxonNameEditorAction(e.getAction(), beanUuid, lazyCombobox, this));
         });
         grid.setComponentAlignment(basionymsComboboxSelect, Alignment.TOP_RIGHT);
         row++;
diff --git a/src/main/java/eu/etaxonomy/vaadin/component/ToManyRelatedEntitiesListSelect.java b/src/main/java/eu/etaxonomy/vaadin/component/ToManyRelatedEntitiesListSelect.java
index 9014c502..37f23bf2 100644
--- a/src/main/java/eu/etaxonomy/vaadin/component/ToManyRelatedEntitiesListSelect.java
+++ b/src/main/java/eu/etaxonomy/vaadin/component/ToManyRelatedEntitiesListSelect.java
@@ -408,8 +408,9 @@ public class ToManyRelatedEntitiesListSelect<V extends Object, F extends Abstrac
             if(withEditButton){
                 addButtonIndex++;
                 // edit
-                ((Button)buttonGroup.getComponent(0)).setDescription(field.getValue() == null ? "New" : "Edit");
-                buttonGroup.getComponent(0).setEnabled(field.getValue() == null
+                Button editCreateButton = ((Button)buttonGroup.getComponent(0));
+                editCreateButton.setDescription(field.getValue() == null ? "New" : "Edit");
+                editCreateButton.setEnabled(field.getValue() == null
                         || field.getValue() != null && testEditButtonPermission(field.getValue()));
             }
             // add
