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
.Team
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>FilteredTeamSelectionDialog class.</p>
28 * @created Sep 24, 2009
31 public class TeamSelectionDialog
extends
32 AbstractFilteredCdmResourceSelectionDialog
<Team
> {
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 team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
40 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
42 public static Team
select(Shell shell
, ConversationHolder conversation
, Team team
){
43 TeamSelectionDialog dialog
= new TeamSelectionDialog(shell
, conversation
,
44 "Choose Team", false, TeamSelectionDialog
.class.getCanonicalName(), team
);
45 return getSelectionFromDialog(dialog
);
49 * <p>Constructor for FilteredTeamSelectionDialog.</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.Team} object.
56 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
58 protected TeamSelectionDialog(Shell shell
, ConversationHolder conversation
,
59 String title
, boolean multi
, String settings
,
61 super(shell
, conversation
, title
, multi
, settings
, cdmObject
);
65 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
69 protected void initModel() {
70 model
= CdmStore
.getService(IAgentService
.class).getTeamUuidAndTitleCache();
75 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
76 return new NewTeamWizard();
81 protected String
getNewWizardLinkText() {
82 return "Click link to create a new <A>Team</A>.";
87 protected Team
getPersistentObject(UUID uuid
) {
88 return (Team
) CdmStore
.getService(IAgentService
.class).load(uuid
);