commit d7edf1e089bd6f3a63904f86bf6160aaa4d1839a
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Wed Jul 25 16:36:01 2018 +0200

    fix #7572  CollectionCaptionGenerator to show collection code and institution in comboboxes

diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/util/CollectionCaptionGenerator.java b/src/main/java/eu/etaxonomy/cdm/vaadin/util/CollectionCaptionGenerator.java
new file mode 100644
index 00000000..18ad1720
--- /dev/null
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/util/CollectionCaptionGenerator.java
@@ -0,0 +1,37 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.vaadin.util;
+
+import java.util.Objects;
+
+import org.vaadin.viritin.fields.CaptionGenerator;
+
+import eu.etaxonomy.cdm.model.occurrence.Collection;
+
+/**
+ * @author a.kohlbecker
+ *
+ */
+public final class CollectionCaptionGenerator implements CaptionGenerator<Collection> {
+
+    private static final long serialVersionUID = 3151383366731447990L;
+
+    public CollectionCaptionGenerator(){
+    }
+
+    @Override
+    public String getCaption(Collection option) {
+        String caption = Objects.toString(option.getCode(), "");
+        option.getTitleCache();
+        if(option.getInstitute() != null){
+            caption += (caption.isEmpty() ? "" : " - ") + option.getInstitute().getTitleCache();
+        }
+        return caption;
+    }
+}
\ No newline at end of file
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
index 209efa4a..c9d94e6b 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/name/SpecimenTypeDesignationWorkingsetEditorPresenter.java
@@ -52,6 +52,7 @@ import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationDTO;
 import eu.etaxonomy.cdm.vaadin.model.registration.SpecimenTypeDesignationWorkingSetDTO;
 import eu.etaxonomy.cdm.vaadin.ui.RegistrationUIDefaults;
 import eu.etaxonomy.cdm.vaadin.util.CdmTitleCacheCaptionGenerator;
+import eu.etaxonomy.cdm.vaadin.util.CollectionCaptionGenerator;
 import eu.etaxonomy.cdm.vaadin.view.occurrence.CollectionPopupEditor;
 import eu.etaxonomy.cdm.vaadin.view.reference.ReferencePopupEditor;
 import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
@@ -207,7 +208,7 @@ public class SpecimenTypeDesignationWorkingsetEditorPresenter
                         collectionPagingProvider,
                         collectionPagingProvider.getPageSize()
                         );
-                row.collection.getSelect().setCaptionGenerator(new CdmTitleCacheCaptionGenerator<Collection>());
+                row.collection.getSelect().setCaptionGenerator(new CollectionCaptionGenerator());
                 row.collection.getSelect().addValueChangeListener(new ToOneRelatedEntityButtonUpdater<Collection>(row.collection));
                 row.collection.getSelect().addValueChangeListener(new ToOneRelatedEntityReloader<Collection>(row.collection.getSelect(),
                         SpecimenTypeDesignationWorkingsetEditorPresenter.this));
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionPopupEditor.java b/src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionPopupEditor.java
index 1c713991..895fb1f2 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionPopupEditor.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/view/occurrence/CollectionPopupEditor.java
@@ -22,6 +22,7 @@ import eu.etaxonomy.cdm.vaadin.event.InstitutionEditorAction;
 import eu.etaxonomy.cdm.vaadin.event.ToOneRelatedEntityButtonUpdater;
 import eu.etaxonomy.cdm.vaadin.permission.AccessRestrictedView;
 import eu.etaxonomy.cdm.vaadin.util.CdmTitleCacheCaptionGenerator;
+import eu.etaxonomy.cdm.vaadin.util.CollectionCaptionGenerator;
 import eu.etaxonomy.vaadin.component.ToOneRelatedEntityCombobox;
 import eu.etaxonomy.vaadin.event.EditorActionType;
 import eu.etaxonomy.vaadin.mvp.AbstractCdmPopupEditor;
@@ -145,7 +146,7 @@ public class CollectionPopupEditor extends AbstractCdmPopupEditor<Collection, Co
         addField(superCollectionCombobox, "superCollection", 0, row, 1, row);
 
         superCollectionCombobox.getSelect().setCaptionGenerator(
-                new CdmTitleCacheCaptionGenerator<Collection>()
+                new CollectionCaptionGenerator()
                 );
         superCollectionCombobox.getSelect().addValueChangeListener(
                 new ToOneRelatedEntityButtonUpdater<Collection>(superCollectionCombobox)
