1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.ui.selection;
|
5
|
|
6
|
import org.eclipse.swt.events.SelectionEvent;
|
7
|
|
8
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
9
|
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
10
|
import eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade;
|
11
|
import eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.NameSelectionDialog;
|
12
|
import eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement;
|
13
|
|
14
|
/**
|
15
|
* <p>
|
16
|
* NameSelectionElement class.
|
17
|
* </p>
|
18
|
*
|
19
|
* @author nho
|
20
|
* @version $Id: $
|
21
|
*/
|
22
|
public class NameSelectionElement extends
|
23
|
AbstractSelectionElement<TaxonNameBase> {
|
24
|
|
25
|
public static final int DEFAULT = EDITABLE | SELECTABLE | DELETABLE;
|
26
|
|
27
|
/**
|
28
|
* <p>
|
29
|
* Constructor for NameSelectionElement.
|
30
|
* </p>
|
31
|
*
|
32
|
* @param labelString
|
33
|
* a {@link java.lang.String} object.
|
34
|
* @param selection
|
35
|
* a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
|
36
|
* @param style
|
37
|
* a int.
|
38
|
* @param toolkit
|
39
|
* a {@link eu.etaxonomy.taxeditor.singlesource.ui.forms.CdmFormFactoryFacade}
|
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.forms.ICdmFormElement}
|
46
|
* object.
|
47
|
*/
|
48
|
public NameSelectionElement(CdmFormFactoryFacade toolkit,
|
49
|
ConversationHolder conversation, ICdmFormElement parentElement,
|
50
|
String labelString, TaxonNameBase selection, int mode, int style) {
|
51
|
super(toolkit, conversation, parentElement, labelString, selection,
|
52
|
mode, style);
|
53
|
}
|
54
|
|
55
|
/*
|
56
|
* (non-Javadoc)
|
57
|
*
|
58
|
* @see
|
59
|
* org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
|
60
|
* .events.SelectionEvent)
|
61
|
*/
|
62
|
/** {@inheritDoc} */
|
63
|
@Override
|
64
|
public void widgetSelected(SelectionEvent e) {
|
65
|
TaxonNameBase newSelection = NameSelectionDialog.select(getShell(),
|
66
|
getConversationHolder(), entity);
|
67
|
setSelectionInternal(newSelection);
|
68
|
}
|
69
|
|
70
|
}
|