2 * Copyright (C) 2019 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
11 import org
.eclipse
.swt
.widgets
.Shell
;
13 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
14 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
15 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.TeamOrPersonBase
;
17 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
24 public class TeamOrPersonBaseSelectionDialog
extends AgentSelectionDialog
<TeamOrPersonBase
> {
32 * @param selectTeamMember
34 protected TeamOrPersonBaseSelectionDialog(Shell shell
, String title
, boolean multi
, String settings
,
35 TeamOrPersonBase agent
, boolean selectTeamMember
) {
36 super(shell
, title
, multi
, settings
, agent
, selectTeamMember
);
37 // TODO Auto-generated constructor stub
45 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
46 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
47 * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
48 * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
50 public static TeamOrPersonBase
select(Shell shell
, //ConversationHolder conversation,
51 TeamOrPersonBase entity
, boolean selectTeamMember
) {
52 TeamOrPersonBaseSelectionDialog dialog
= new TeamOrPersonBaseSelectionDialog(shell
, //conversation,
53 "Choose Team or Person", false, TeamOrPersonBaseSelectionDialog
.class.getCanonicalName(), entity
, selectTeamMember
);
54 return (TeamOrPersonBase
)getSelectionFromDialog(dialog
);
58 void callService(String pattern
) {
59 model
= CdmStore
.getService(IAgentService
.class).getUuidAndTitleCache(Team
.class,limitOfInitialElements
, pattern
);
60 model
.addAll( CdmStore
.getService(IAgentService
.class).getUuidAndTitleCache(Person
.class,limitOfInitialElements
, pattern
));
69 protected String
getTitle(TeamOrPersonBase cdmObject
) {
70 if(cdmObject
== null){
73 return cdmObject
.getTitleCache();