2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
11 import java
.util
.UUID
;
13 import org
.eclipse
.swt
.widgets
.Shell
;
15 import eu
.etaxonomy
.cdm
.api
.service
.INameService
;
16 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
17 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
18 import eu
.etaxonomy
.taxeditor
.newWizard
.NewNonViralNameWizard
;
19 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 public class NameSelectionDialog
extends AbstractFilteredCdmResourceSelectionDialog
<TaxonName
> {
27 public static TaxonName
select(Shell shell
,
29 NameSelectionDialog dialog
= new NameSelectionDialog(shell
,
30 "Choose a name", false, name
);
31 return getSelectionFromDialog(dialog
);
34 protected NameSelectionDialog(Shell shell
,
35 String title
, boolean multi
, TaxonName name
) {
37 title
, multi
, NameSelectionDialog
.class.getCanonicalName(), name
);
41 protected TaxonName
getPersistentObject(UUID cdmUuid
) {
42 return CdmStore
.getService(INameService
.class).load(cdmUuid
);
46 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
47 return new NewNonViralNameWizard();
51 protected String
[] getNewWizardText() {
52 return new String
[]{"New Name"};
56 protected void callService(String pattern
) {
57 model
= CdmStore
.getService(INameService
.class).getUuidAndTitleCache(limitOfInitialElements
, pattern
);