ref #7309: add collectorTitle/titleCache to editor
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / AgentSelectionDialog.java
index eb2da576e05b85ffe4259aaa676b53f5d3066bd8..207e2c71519fb8e6708132b85de5da09ec5bac4c 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.swt.widgets.Shell;
 import eu.etaxonomy.cdm.api.service.IAgentService;
 import eu.etaxonomy.cdm.model.agent.AgentBase;
 import eu.etaxonomy.cdm.model.agent.INomenclaturalAuthor;
+import eu.etaxonomy.cdm.model.agent.Person;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
 import eu.etaxonomy.taxeditor.newWizard.NewPersonWizard;
@@ -73,7 +74,7 @@ public class AgentSelectionDialog<T extends AgentBase>
         public String getText(Object element) {
                    T agent = getCdmObjectByUuid(((UuidAndTitleCache<AgentBase>) element).getUuid());
                        if (agent instanceof INomenclaturalAuthor) {
-                               return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitle() + "'";
+                               return "Nomenclatural title: '" + ((INomenclaturalAuthor) agent).getNomenclaturalTitleCache() + "'";
                        } else {
                                return "'" + agent.getTitleCache() + "' is not a nomenclatural author.";
                        }
@@ -120,6 +121,10 @@ public class AgentSelectionDialog<T extends AgentBase>
     @Override
     protected void callService(String pattern) {
         Class<T> clazz = (Class)AgentBase.class;
+        if (selectTeamMember){
+            clazz = (Class)Person.class;
+        }
+
         model = CdmStore.getService(IAgentService.class).getUuidAndTitleCache(clazz, limitOfInitialElements, pattern);
     }
 }
\ No newline at end of file