From 2040fc2c9d46b9e4067c16d5306175e7dd4162d6 Mon Sep 17 00:00:00 2001 From: Katja Luther Date: Thu, 4 Apr 2019 10:53:55 +0200 Subject: [PATCH] ref #8111: fix selection of user --- .../dialog/selection/SelectionDialogFactory.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java index d87c1ad1e..c8d9eba8c 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/SelectionDialogFactory.java @@ -48,9 +48,13 @@ import eu.etaxonomy.taxeditor.ui.element.IEntityElement; import eu.etaxonomy.taxeditor.ui.section.agent.TeamMemberElement; import eu.etaxonomy.taxeditor.ui.section.description.CommonNameSourceElement; import eu.etaxonomy.taxeditor.ui.section.description.detail.CommonNameDetailElement; +import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailElement; +import eu.etaxonomy.taxeditor.ui.section.group.MemberDetailSection; import eu.etaxonomy.taxeditor.ui.section.name.AuthorshipDetailElement; import eu.etaxonomy.taxeditor.ui.section.reference.NomenclaturalReferenceDetailElement; import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceDetailElement; +import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailElement; +import eu.etaxonomy.taxeditor.ui.section.user.GroupsByUserDetailSection; /** * @author n.hoffmann @@ -174,9 +178,10 @@ public class SelectionDialogFactory { return (T) CollectionSelectionDialog.select(shell, //conversation, (Collection) currentSelection); } - if(clazz.equals(User.class)){ + if(clazz.equals(User.class) && parentElement instanceof MemberDetailElement){ + MemberDetailSection section = (MemberDetailSection)((MemberDetailElement)parentElement).getParentElement(); return (T) UserSelectionDialog.select(shell, //conversation, - (User) currentSelection, null); + (User) currentSelection, section.getEntity()); } if(clazz.equals(GrantedAuthorityImpl.class)){ return (T) GrantedAuthoritySelectionDialog.select(shell, //conversation, @@ -186,9 +191,10 @@ public class SelectionDialogFactory { return (T) PersonSelectionDialog.select(shell, //conversation, (Person) currentSelection); } - if(clazz.equals(Group.class)){ + if(clazz.equals(Group.class) && parentElement instanceof GroupsByUserDetailElement){ + GroupsByUserDetailSection section =(GroupsByUserDetailSection)((GroupsByUserDetailElement)parentElement).getParentElement(); return (T) GroupSelectionDialog.select(shell, //conversation, - (Group) currentSelection, null); + (Group) currentSelection, section.getEntity()); } if(clazz.equals(Institution.class)){ return (T) InstitutionSelectionDialog.select(shell, //conversation, -- 2.34.1