1
|
/**
|
2
|
* Copyright (C) 2016 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
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.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.ui.dialog.selection;
|
10
|
|
11
|
import org.eclipse.swt.widgets.Control;
|
12
|
import org.eclipse.swt.widgets.Shell;
|
13
|
import org.eclipse.swt.widgets.Text;
|
14
|
|
15
|
import eu.etaxonomy.cdm.api.service.IAgentService;
|
16
|
import eu.etaxonomy.cdm.model.agent.AgentBase;
|
17
|
import eu.etaxonomy.cdm.model.agent.Person;
|
18
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
19
|
|
20
|
/**
|
21
|
* @author k.luther
|
22
|
* @date 21.06.2016
|
23
|
*
|
24
|
*/
|
25
|
public class NomenclaturalPersonAuthorSelectionDialog extends NomenclaturalAuthorSelectionDialog {
|
26
|
|
27
|
/**
|
28
|
* @param shell
|
29
|
* @param conversation
|
30
|
* @param title
|
31
|
* @param multi
|
32
|
* @param settings
|
33
|
* @param agent
|
34
|
*/
|
35
|
protected NomenclaturalPersonAuthorSelectionDialog(Shell shell, //ConversationHolder conversation,
|
36
|
String title,
|
37
|
boolean multi, String settings, AgentBase agent, boolean teamMemberSelection) {
|
38
|
super(shell, //conversation,
|
39
|
title, multi, settings, agent, teamMemberSelection);
|
40
|
// TODO Auto-generated constructor stub
|
41
|
}
|
42
|
|
43
|
|
44
|
/**
|
45
|
* <p>select</p>
|
46
|
*
|
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.
|
51
|
*/
|
52
|
public static AgentBase select(Shell shell, //ConversationHolder conversation,
|
53
|
AgentBase entity, boolean teamMemberSelection) {
|
54
|
NomenclaturalPersonAuthorSelectionDialog dialog = new NomenclaturalPersonAuthorSelectionDialog(shell, //conversation,
|
55
|
"Choose Agent", false, NomenclaturalAuthorSelectionDialog.class.getCanonicalName(), entity,teamMemberSelection);
|
56
|
return getSelectionFromDialog(dialog);
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
protected void search() {
|
61
|
Control control =getSearchField();
|
62
|
String pattern = null;
|
63
|
if (control != null){
|
64
|
pattern = ((Text)control).getText();
|
65
|
}
|
66
|
|
67
|
model = CdmStore.getService(IAgentService.class).getUuidAndAbbrevTitleCache(limitOfInitialElements, pattern, Person.class);
|
68
|
}
|
69
|
|
70
|
}
|