3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
13 import java
.util
.UUID
;
15 import org
.eclipse
.swt
.widgets
.Shell
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.api
.service
.INameService
;
19 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.NewNonViralNameWizard
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
29 public class NameSelectionDialog
extends AbstractFilteredCdmResourceSelectionDialog
<TaxonNameBase
> {
31 public static TaxonNameBase
select(Shell shell
, ConversationHolder conversation
, TaxonNameBase name
) {
32 NameSelectionDialog dialog
= new NameSelectionDialog(shell
, conversation
,
33 "Choose a name", false, name
);
34 return getSelectionFromDialog(dialog
);
37 protected NameSelectionDialog(Shell shell
, ConversationHolder conversation
, String title
, boolean multi
, TaxonNameBase name
) {
38 super(shell
, conversation
, title
, multi
, NameSelectionDialog
.class.getCanonicalName(), name
);
43 protected TaxonNameBase
getPersistentObject(UUID cdmUuid
) {
44 return CdmStore
.getService(INameService
.class).load(cdmUuid
);
49 protected void initModel() {
50 model
= CdmStore
.getService(INameService
.class).getUuidAndTitleCache();
55 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
56 return new NewNonViralNameWizard();
61 protected String
getNewWizardLinkText() {
62 return String
.format("Create a new <a>%1s</a>", "Name ");