1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.ui.selection;
|
11
|
|
12
|
import org.eclipse.swt.events.SelectionEvent;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.agent.Team;
|
15
|
import eu.etaxonomy.taxeditor.ui.dialog.selection.NomenclaturalAuthorTeamSelectionDialog;
|
16
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
17
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
18
|
|
19
|
/**
|
20
|
* <p>
|
21
|
* NomenclaturalAuthorTeamSelectionElement class.
|
22
|
* </p>
|
23
|
*
|
24
|
* @author n.hoffmann
|
25
|
* @created Jun 22, 2010
|
26
|
* @version 1.0
|
27
|
*/
|
28
|
public class NomenclaturalAuthorTeamSelectionElement extends
|
29
|
EntitySelectionElement<Team> {
|
30
|
|
31
|
public static final int DEFAULT = EDITABLE | SELECTABLE | DELETABLE;
|
32
|
|
33
|
/**
|
34
|
* <p>
|
35
|
* Constructor for NomenclaturalAuthorTeamSelectionElement.
|
36
|
* </p>
|
37
|
*
|
38
|
* @param formFactory
|
39
|
* a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
|
40
|
* object.
|
41
|
* @param conversation
|
42
|
* a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
|
43
|
* object.
|
44
|
* @param parentElement
|
45
|
* a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
|
46
|
* object.
|
47
|
* @param labelString
|
48
|
* a {@link java.lang.String} object.
|
49
|
* @param entity
|
50
|
* a {@link eu.etaxonomy.cdm.model.agent.Team} object.
|
51
|
* @param style
|
52
|
* a int.
|
53
|
*/
|
54
|
public NomenclaturalAuthorTeamSelectionElement(CdmFormFactory formFactory,//ConversationHolder conversation,
|
55
|
ICdmFormElement parentElement,
|
56
|
String labelString, Team entity, int mode, int style) {
|
57
|
super(formFactory,// conversation,
|
58
|
parentElement, Team.class, labelString, entity,
|
59
|
mode, style);
|
60
|
}
|
61
|
|
62
|
/** {@inheritDoc} */
|
63
|
@Override
|
64
|
protected String getTitle() {
|
65
|
return (entity != null) ? entity.getNomenclaturalTitleCache() : "";
|
66
|
}
|
67
|
|
68
|
/** {@inheritDoc} */
|
69
|
@Override
|
70
|
public void widgetSelected(SelectionEvent e) {
|
71
|
Team newSelection = NomenclaturalAuthorTeamSelectionDialog.select(
|
72
|
getShell(), //getConversationHolder(),
|
73
|
entity);
|
74
|
setSelectionInternal(newSelection);
|
75
|
}
|
76
|
}
|