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
.IAgentService
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
20 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
22 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 * <p>FilteredTeamSelectionDialog class.</p>
29 * @created Sep 24, 2009
32 public class TeamSelectionDialog
extends
33 AbstractFilteredCdmResourceSelectionDialog
<Team
> {
38 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
39 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
40 * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
41 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
43 public static Team
select(Shell shell
, ConversationHolder conversation
, Team team
){
44 TeamSelectionDialog dialog
= new TeamSelectionDialog(shell
, conversation
,
45 "Choose Team", false, TeamSelectionDialog
.class.getCanonicalName(), team
);
46 return getSelectionFromDialog(dialog
);
50 * <p>Constructor for FilteredTeamSelectionDialog.</p>
52 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
53 * @param title a {@link java.lang.String} object.
54 * @param multi a boolean.
55 * @param settings a {@link java.lang.String} object.
56 * @param cdmObject a {@link eu.etaxonomy.cdm.model.agent.Team} object.
57 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
59 protected TeamSelectionDialog(Shell shell
, ConversationHolder conversation
,
60 String title
, boolean multi
, String settings
,
62 super(shell
, conversation
, title
, multi
, settings
, cdmObject
);
66 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
70 protected void initModel() {
71 model
= CdmStore
.getService(IAgentService
.class).getTeamUuidAndTitleCache();
76 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
77 return new NewTeamWizard();
82 protected String
getNewWizardLinkText() {
83 return String
.format("Create a new <a>%1s</a>", "Team ");
88 protected Team
getPersistentObject(UUID uuid
) {
89 return CdmBase
.deproxy(CdmStore
.getService(IAgentService
.class).load(uuid
), Team
.class);