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.
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
.INameService
;
17 import eu
.etaxonomy
.cdm
.model
.name
.TaxonName
;
18 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.NewNonViralNameWizard
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 public class NameSelectionDialog
extends AbstractFilteredCdmResourceSelectionDialog
<TaxonName
> {
28 public static TaxonName
select(Shell shell
, //ConversationHolder conversation,
30 NameSelectionDialog dialog
= new NameSelectionDialog(shell
, //conversation,
31 "Choose a name", false, name
);
32 return getSelectionFromDialog(dialog
);
35 protected NameSelectionDialog(Shell shell
, //ConversationHolder conversation,
36 String title
, boolean multi
, TaxonName name
) {
37 super(shell
, //conversation,
38 title
, multi
, NameSelectionDialog
.class.getCanonicalName(), name
);
43 protected TaxonName
getPersistentObject(UUID cdmUuid
) {
44 return CdmStore
.getService(INameService
.class).load(cdmUuid
);
49 // protected void search() {
50 // Control control =getSearchField();
51 // String pattern = null;
52 // if (control != null){
53 // pattern = ((Text)control).getText();
56 // if (pattern.equals("?")){
57 // model = CdmStore.getService(INameService.class).getUuidAndTitleCache(null, null);
58 // }else if (pattern != null){
59 // model = CdmStore.getService(INameService.class).getUuidAndTitleCache(limitOfInitialElements, pattern);
65 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
66 return new NewNonViralNameWizard();
71 protected String
[] getNewWizardText() {
72 return new String
[]{"New Name"};
76 * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#callService(java.lang.String)
79 void callService(String pattern
) {
80 model
= CdmStore
.getService(INameService
.class).getUuidAndTitleCache(limitOfInitialElements
, pattern
);