Add support for generic SpecimenOrObservationBase class to
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / selection / OriginalSourceTypeSelectionDialog.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.ui.dialog.selection;
12
13 import java.util.ArrayList;
14 import java.util.EnumSet;
15
16 import org.eclipse.swt.widgets.Shell;
17
18 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
19 import eu.etaxonomy.cdm.model.common.OriginalSourceType;
20 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
21
22 /**
23 * <p>OriginalSourceTypeSelectionDialog class.</p>
24 *
25 * @author c.mathew
26 * @created 18.07.2013
27 * @version 1.0
28 */
29 public class OriginalSourceTypeSelectionDialog extends
30 AbstractFilteredCdmEnumSelectionDialog<OriginalSourceType> {
31
32 /**
33 * <p>select</p>
34 *
35 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @return a {@link eu.etaxonomy.cdm.model.common.OriginalSourceType} object.
38 */
39 public static OriginalSourceType select(Shell shell, ConversationHolder conversation){
40 OriginalSourceTypeSelectionDialog dialog =
41 new OriginalSourceTypeSelectionDialog(shell,
42 conversation,
43 "Choose Original Source Type",
44 false,
45 OriginalSourceTypeSelectionDialog.class.getCanonicalName());
46 return getSelectionFromDialog(dialog);
47 }
48
49 /**
50 * <p>Constructor for FilteredDerivedUnitSelectionDialog.</p>
51 *
52 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
53 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
54 * @param title a {@link java.lang.String} object.
55 * @param multi a boolean.
56 * @param settings a {@link java.lang.String} object.
57 */
58 protected OriginalSourceTypeSelectionDialog(Shell shell,
59 ConversationHolder conversation,
60 String title,
61 boolean multi,
62 String settings) {
63 super(shell, conversation, title, multi, settings, OriginalSourceType.PrimaryTaxonomicSource);
64 }
65
66
67 /** {@inheritDoc} */
68 @Override
69 protected void initModel() {
70 model = new ArrayList<OriginalSourceType>();
71 model.addAll(EnumSet.allOf(OriginalSourceType.class));
72 }
73
74 /** {@inheritDoc} */
75 @Override
76 protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
77 return null;
78 }
79
80 /** {@inheritDoc} */
81 @Override
82 protected String getNewWizardLinkText() {
83 return null;
84 }
85 }