3 * Copyright (C) 2016 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
12 import org
.eclipse
.swt
.widgets
.Control
;
13 import org
.eclipse
.swt
.widgets
.Shell
;
14 import org
.eclipse
.swt
.widgets
.Text
;
16 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
17 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 public class NomenclaturalPersonAuthorSelectionDialog
extends NomenclaturalAuthorSelectionDialog
{
37 protected NomenclaturalPersonAuthorSelectionDialog(Shell shell
, ConversationHolder conversation
, String title
,
38 boolean multi
, String settings
, AgentBase agent
) {
39 super(shell
, conversation
, title
, multi
, settings
, agent
);
40 // TODO Auto-generated constructor stub
47 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
48 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
49 * @param entity a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
50 * @return a {@link eu.etaxonomy.cdm.model.agent.AgentBase} object.
52 public static AgentBase
select(Shell shell
, ConversationHolder conversation
, AgentBase entity
) {
53 NomenclaturalPersonAuthorSelectionDialog dialog
= new NomenclaturalPersonAuthorSelectionDialog(shell
, conversation
,
54 "Choose Agent", false, NomenclaturalAuthorSelectionDialog
.class.getCanonicalName(), entity
);
55 return getSelectionFromDialog(dialog
);
59 protected void initModel() {
60 Control control
= getPatternControl();
61 String pattern
= null;
63 pattern
= ((Text
)control
).getText();
66 model
= CdmStore
.getService(IAgentService
.class).getUuidAndAbbrevTitleCache(limitOfInitialElements
, pattern
, Person
.class);