1
|
/**
|
2
|
* Copyright (C) 2018 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.Shell;
|
12
|
|
13
|
import eu.etaxonomy.cdm.api.service.IReferenceService;
|
14
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
15
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
16
|
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
|
17
|
import eu.etaxonomy.taxeditor.newWizard.NewCommonNameReferenceWizard;
|
18
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
19
|
|
20
|
/**
|
21
|
* @author k.luther
|
22
|
* @since 26.09.2018
|
23
|
*/
|
24
|
public class CommonNameReferenceSelectionDialog extends ReferenceSelectionDialog {
|
25
|
|
26
|
protected CommonNameReferenceSelectionDialog(Shell shell, String title, boolean multi, Reference reference) {
|
27
|
super(shell, title, multi, reference, null);
|
28
|
}
|
29
|
|
30
|
@Override
|
31
|
protected void callService(String pattern) {
|
32
|
model = CdmStore.getService(IReferenceService.class).findUuidAndTitleCacheByMarker(100, pattern, MarkerType.COMMON_NAME_REFERENCE());
|
33
|
}
|
34
|
|
35
|
public static Reference select(Shell shell,
|
36
|
Reference reference) {
|
37
|
CommonNameReferenceSelectionDialog dialog = new CommonNameReferenceSelectionDialog(shell,// conversation,
|
38
|
"Choose a common name reference", isInReference, reference);
|
39
|
return getSelectionFromDialog(dialog);
|
40
|
}
|
41
|
|
42
|
@Override
|
43
|
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
|
44
|
return new NewCommonNameReferenceWizard(null);
|
45
|
}
|
46
|
}
|