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.
9 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
11 import java
.util
.UUID
;
13 import org
.eclipse
.swt
.widgets
.Shell
;
15 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
16 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
17 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
18 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
24 * @created Sep 24, 2009
26 public class TeamSelectionDialog
extends
27 AbstractFilteredCdmResourceSelectionDialog
<Team
> {
29 public static Team
select(Shell shell
,
31 TeamSelectionDialog dialog
= new TeamSelectionDialog(shell
,
32 "Choose Team", false, TeamSelectionDialog
.class.getCanonicalName(), team
);
33 return getSelectionFromDialog(dialog
);
36 protected TeamSelectionDialog(Shell shell
,
37 String title
, boolean multi
, String settings
,
39 super(shell
, title
, multi
, settings
, cdmObject
);
43 protected void callService(String pattern
) {
44 model
= CdmStore
.getService(IAgentService
.class).getUuidAndTitleCache(Team
.class, limitOfInitialElements
, pattern
);
49 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
50 return new NewTeamWizard();
54 protected String
[] getNewWizardText() {
55 return new String
[]{"New Team"};
59 protected Team
getPersistentObject(UUID uuid
) {
60 return CdmBase
.deproxy(CdmStore
.getService(IAgentService
.class).load(uuid
), Team
.class);