performed javacscript:fix and worked on documentation
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / dialogs / filteredSelection / FilteredNomenclaturalAuthorTeamSelectionDialog.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.dialogs.filteredSelection;
12
13 import java.util.UUID;
14
15 import org.eclipse.swt.widgets.Shell;
16
17 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
18 import eu.etaxonomy.cdm.model.agent.Team;
19 import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
20 import eu.etaxonomy.taxeditor.editor.newWizard.NewTeamWizard;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22
23 /**
24 * <p>FilteredNomenclaturalAuthorTeamSelectionDialog class.</p>
25 *
26 * @author n.hoffmann
27 * @created Jun 22, 2010
28 * @version 1.0
29 */
30 public class FilteredNomenclaturalAuthorTeamSelectionDialog extends
31 AbstractFilteredCdmResourceSelectionDialog<Team> {
32
33 /**
34 * <p>select</p>
35 *
36 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
39 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
40 */
41 public static Team select(Shell shell, ConversationHolder conversation, Team team){
42 FilteredNomenclaturalAuthorTeamSelectionDialog dialog = new FilteredNomenclaturalAuthorTeamSelectionDialog(shell, conversation,
43 "Choose Author Team", false, FilteredNomenclaturalAuthorTeamSelectionDialog.class.getCanonicalName(), team);
44 return getSelectionFromDialog(dialog);
45 }
46
47 /**
48 * <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
49 *
50 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
51 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} 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 agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
56 */
57 protected FilteredNomenclaturalAuthorTeamSelectionDialog(Shell shell, ConversationHolder conversation, String title,
58 boolean multi, String settings, Team agent) {
59 super(shell, conversation, title, multi, settings, agent);
60 }
61
62 /** {@inheritDoc} */
63 @Override
64 protected AbstractNewEntityWizard getNewEntityWizard() {
65 return new NewTeamWizard();
66 }
67
68 /** {@inheritDoc} */
69 @Override
70 protected String getNewWizardLinkText() {
71 return "Click link to create a new <A>Team</A>.";
72 }
73
74 /** {@inheritDoc} */
75 @Override
76 protected void initModel() {
77 model = CdmStore.getAgentService().getTeamUuidAndNomenclaturalTitle();
78 }
79
80 /** {@inheritDoc} */
81 @Override
82 protected Team getPersistentObject(UUID uuid) {
83 return (Team) CdmStore.getAgentService().load(uuid);
84 }
85 }