2 * Copyright (C) 2016 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
.Control
;
12 import org
.eclipse
.swt
.widgets
.Shell
;
13 import org
.eclipse
.swt
.widgets
.Text
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
19 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 public class NomenclaturalPersonAuthorSelectionDialog
extends NomenclaturalAuthorSelectionDialog
{
36 protected NomenclaturalPersonAuthorSelectionDialog(Shell shell
, ConversationHolder conversation
, String title
,
37 boolean multi
, String settings
, AgentBase agent
, boolean teamMemberSelection
) {
38 super(shell
, conversation
, title
, multi
, settings
, agent
, teamMemberSelection
);
39 // TODO Auto-generated constructor stub
46 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
47 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
48 * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
49 * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
51 public static AgentBase
select(Shell shell
, ConversationHolder conversation
, AgentBase entity
, boolean teamMemberSelection
) {
52 NomenclaturalPersonAuthorSelectionDialog dialog
= new NomenclaturalPersonAuthorSelectionDialog(shell
, conversation
,
53 "Choose Agent", false, NomenclaturalAuthorSelectionDialog
.class.getCanonicalName(), entity
,teamMemberSelection
);
54 return getSelectionFromDialog(dialog
);
58 protected void initModel() {
59 Control control
= getPatternControl();
60 String pattern
= null;
62 pattern
= ((Text
)control
).getText();
65 model
= CdmStore
.getService(IAgentService
.class).getUuidAndAbbrevTitleCache(limitOfInitialElements
, pattern
, Person
.class);