1
|
//$Id$
|
2
|
|
3
|
package eu.etaxonomy.taxeditor.ui.dialog.selection;
|
4
|
|
5
|
import java.util.ArrayList;
|
6
|
import java.util.EnumSet;
|
7
|
|
8
|
import org.eclipse.swt.widgets.Shell;
|
9
|
|
10
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
11
|
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
|
12
|
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
|
13
|
|
14
|
/**
|
15
|
* <p>OriginalSourceTypeSelectionDialog class.</p>
|
16
|
*
|
17
|
* @author c.mathew
|
18
|
* @created 18.07.2013
|
19
|
* @version 1.0
|
20
|
*/
|
21
|
public class SpecimenOrObservationTypeSelectionDialog extends
|
22
|
AbstractFilteredCdmEnumSelectionDialog<SpecimenOrObservationType> {
|
23
|
|
24
|
/**
|
25
|
* <p>select</p>
|
26
|
*
|
27
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
28
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
29
|
* @return a {@link eu.etaxonomy.cdm.model.common.OriginalSourceType} object.
|
30
|
*/
|
31
|
public static SpecimenOrObservationType select(Shell shell, ConversationHolder conversation){
|
32
|
SpecimenOrObservationTypeSelectionDialog dialog =
|
33
|
new SpecimenOrObservationTypeSelectionDialog(shell,
|
34
|
conversation,
|
35
|
"Choose Specimen / Observation Type",
|
36
|
false,
|
37
|
SpecimenOrObservationTypeSelectionDialog.class.getCanonicalName());
|
38
|
return getSelectionFromDialog(dialog);
|
39
|
}
|
40
|
|
41
|
/**
|
42
|
* <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
|
43
|
*
|
44
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
45
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
46
|
* @param title a {@link java.lang.String} object.
|
47
|
* @param multi a boolean.
|
48
|
* @param settings a {@link java.lang.String} object.
|
49
|
*/
|
50
|
protected SpecimenOrObservationTypeSelectionDialog(Shell shell,
|
51
|
ConversationHolder conversation,
|
52
|
String title,
|
53
|
boolean multi,
|
54
|
String settings) {
|
55
|
super(shell, conversation, title, multi, settings, SpecimenOrObservationType.Unknown);
|
56
|
}
|
57
|
|
58
|
|
59
|
/** {@inheritDoc} */
|
60
|
@Override
|
61
|
protected void initModel() {
|
62
|
model = new ArrayList<SpecimenOrObservationType>();
|
63
|
model.addAll(EnumSet.allOf(SpecimenOrObservationType.class));
|
64
|
}
|
65
|
|
66
|
/** {@inheritDoc} */
|
67
|
@Override
|
68
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
69
|
return null;
|
70
|
}
|
71
|
|
72
|
/** {@inheritDoc} */
|
73
|
@Override
|
74
|
protected String getNewWizardLinkText() {
|
75
|
return null;
|
76
|
}
|
77
|
}
|