3 * Copyright (C) 2018 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.swt
.widgets
.Shell
;
16 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonService
;
17 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
18 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTaxonWizard
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 public class TaxonSelectionDialog
extends TaxonBaseSelectionDialog
<Taxon
> {
38 * @param taxonToBeFiltered
40 protected TaxonSelectionDialog(Class
<?
extends TaxonBase
> clazz
, Shell shell
, String title
, boolean multi
,
41 TaxonBase taxon
, TaxonBase taxonToBeFiltered
) {
42 super(clazz
, shell
, title
, multi
, taxon
, taxonToBeFiltered
);
43 // TODO Auto-generated constructor stub
46 public static Taxon
selectTaxon(Shell shell
, //ConversationHolder conversation,
47 Taxon taxonToBeFiltered
) {
48 AbstractFilteredCdmResourceSelectionDialog
<Taxon
> dialog
= new TaxonSelectionDialog(Taxon
.class, shell
, //conversation,
49 "Choose a taxon", false, null, taxonToBeFiltered
);
50 return getSelectionFromDialog(dialog
);
55 protected void callService(String pattern
) {
56 model
= CdmStore
.getService(ITaxonService
.class).getUuidAndTitleCache(Taxon
.class, limitOfInitialElements
, pattern
);
61 protected Taxon
getPersistentObject(UUID uuid
) {
62 return (Taxon
) CdmStore
.getService(ITaxonService
.class).load(uuid
);
66 * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardText()
69 protected String
[] getNewWizardText() {
70 return new String
[]{"New Taxon"};
74 * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String)
77 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
78 return new NewTaxonWizard();