2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.swt
.widgets
.Shell
;
16 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
18 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
24 * <p>FilteredTeamSelectionDialog class.</p>
27 * @created Sep 24, 2009
30 public class TeamSelectionDialog
extends
31 AbstractFilteredCdmResourceSelectionDialog
<Team
> {
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.
41 public static Team
select(Shell shell
, //ConversationHolder conversation,
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,
62 title
, multi
, settings
, cdmObject
);
66 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
70 protected void callService(String pattern
) {
71 model
= CdmStore
.getService(IAgentService
.class).getUuidAndTitleCache(Team
.class, limitOfInitialElements
, pattern
);
77 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
78 return new NewTeamWizard();
83 protected String
[] getNewWizardText() {
84 return new String
[]{"New Team"};
89 protected Team
getPersistentObject(UUID uuid
) {
90 return CdmBase
.deproxy(CdmStore
.getService(IAgentService
.class).load(uuid
), Team
.class);