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
.dialogs
.filteredSelection
;
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
.IAgentService
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Person
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.NewPersonWizard
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>FilteredPersonSelectionDialog class.</p>
28 * @created Sep 24, 2009
31 public class PersonSelectionDialog
extends
32 AbstractFilteredCdmResourceSelectionDialog
<Person
> {
37 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
38 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
39 * @param person a {@link eu.etaxonomy.cdm.model.agent.Person} object.
40 * @return a {@link eu.etaxonomy.cdm.model.agent.Person} object.
42 public static Person
select(Shell shell
, ConversationHolder conversation
, Person person
){
43 PersonSelectionDialog dialog
= new PersonSelectionDialog(shell
, conversation
,
44 "Choose a person", false, PersonSelectionDialog
.class.getCanonicalName(), person
);
45 return getSelectionFromDialog(dialog
);
49 * <p>Constructor for FilteredPersonSelectionDialog.</p>
51 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
52 * @param title a {@link java.lang.String} object.
53 * @param multi a boolean.
54 * @param settings a {@link java.lang.String} object.
55 * @param cdmObject a {@link eu.etaxonomy.cdm.model.agent.Person} object.
56 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
58 protected PersonSelectionDialog(Shell shell
, ConversationHolder conversation
, String title
,
59 boolean multi
, String settings
, Person cdmObject
) {
60 super(shell
, conversation
, title
, multi
, settings
, cdmObject
);
66 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
70 protected Person
getPersistentObject(UUID uuid
) {
71 return (Person
) CdmStore
.getService(IAgentService
.class).load(uuid
);
75 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
79 protected void initModel() {
80 model
= CdmStore
.getService(IAgentService
.class).getPersonUuidAndTitleCache();
85 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
86 return new NewPersonWizard();
91 protected String
getNewWizardLinkText() {
92 return "Click link to create a new <A>Person</A>.";