-// $Id$
/**
* Copyright (C) 2009 EDIT
* European Distributed Institute of Taxonomy
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.model.common.ICdmBase;
-import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.cdm.model.common.User;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureTree;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
import eu.etaxonomy.cdm.model.location.Country;
import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.cdm.model.molecular.Amplification;
import eu.etaxonomy.cdm.model.molecular.Primer;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.IEntityElement;
import eu.etaxonomy.taxeditor.ui.section.agent.TeamMemberElement;
-import eu.etaxonomy.taxeditor.ui.section.description.detail.DistributionDetailElement;
import eu.etaxonomy.taxeditor.ui.section.name.AuthorshipDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement;
/**
* @author n.hoffmann
if(clazz.equals(TaxonNode.class)){
return (T) TaxonNodeSelectionDialog.select(shell, conversation, null, null, (TaxonNode) currentSelection, ((TaxonNode) currentSelection).getClassification());
}
+ if(clazz.equals(Reference.class) && parentElement instanceof NomenclaturalReferenceDetailElement){
+ return (T) NomenclaturalReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
+ }
if(clazz.equals(Reference.class)){
return (T) ReferenceSelectionDialog.select(shell, conversation, (Reference) currentSelection);
}
+
if(clazz.equals(TaxonNameBase.class)){
return (T) NameSelectionDialog.select(shell, conversation, (TaxonNameBase) currentSelection);
}
return (T) TeamSelectionDialog.select(shell, conversation, (Team) currentSelection);
}
if(clazz.equals(TeamOrPersonBase.class) && parentElement instanceof AuthorshipDetailElement){
- return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}else if(clazz.equals(TeamOrPersonBase.class)){
//TODO: add TeamOrPersonBaseSelectionDialog (see ticket #4545)
- return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}
if(clazz.equals(Person.class) && parentElement instanceof TeamMemberElement){
- return (T) NomenclaturalAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) NomenclaturalPersonAuthorSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, true);
}
if(clazz.equals(AgentBase.class)){
- return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection);
+ return (T) AgentSelectionDialog.select(shell, conversation, (AgentBase) currentSelection, false);
}
if(clazz.equals(Feature.class)){
return (T) FeatureSelectionDialog.select(shell, conversation, (Feature) currentSelection);
return (T) SpecimenOrObservationBaseSelectionDialog.select(shell, conversation, (SpecimenOrObservationBase) currentSelection);
}
if(clazz.equals(NamedArea.class)){
- if(parentElement instanceof DistributionDetailElement){
-// return (T) NamedAreaSelectionForDistributionDialog.select(shell, conversation, (NamedArea) currentSelection, CdmStore.getTermManager().getPreferredVocabulary(TermType.NamedArea));
- return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection, Country.uuidCountryVocabulary);
- }else if(parentElement instanceof IEntityElement && ((IEntityElement) parentElement).getEntity() instanceof DerivedUnitFacade){
- return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection, Country.uuidCountryVocabulary);
+ if(parentElement instanceof IEntityElement && ((IEntityElement) parentElement).getEntity() instanceof DerivedUnitFacade){
+ return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection, DerivedUnit.class.getCanonicalName(), Country.uuidCountryVocabulary);
}
else{
- return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection);
+ return (T) NamedAreaSelectionDialog.select(shell, conversation, (NamedArea) currentSelection, parentElement.getClass().getCanonicalName());
}
}
if(clazz.equals(Collection.class)){
if(clazz.equals(Amplification.class)){
return (T) AmplificationSelectionDialog.select(shell, conversation, (Amplification) currentSelection);
}
+ if(clazz.equals(Media.class)){
+ return (T) MediaSelectionDialog.select(shell, conversation, (Media) currentSelection);
+ }
return null;
}