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
.Control
;
15 import org
.eclipse
.swt
.widgets
.Shell
;
16 import org
.eclipse
.swt
.widgets
.Text
;
18 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
19 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
21 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
22 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
23 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
24 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
25 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 * <p>FilteredNomenclaturalAuthorTeamSelectionDialog class.</p>
31 * @created Jun 22, 2010
34 public class NomenclaturalAuthorTeamSelectionDialog
extends
35 AbstractFilteredCdmResourceSelectionDialog
<AgentBase
> {
40 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
41 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
42 * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
43 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
45 public static Team
select(Shell shell
, ConversationHolder conversation
, Team team
){
46 NomenclaturalAuthorTeamSelectionDialog dialog
= new NomenclaturalAuthorTeamSelectionDialog(shell
, conversation
,
47 "Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog
.class.getCanonicalName(), team
);
48 return (Team
)getSelectionFromDialog(dialog
);
52 * <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
54 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
55 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
56 * @param title a {@link java.lang.String} object.
57 * @param multi a boolean.
58 * @param settings a {@link java.lang.String} object.
59 * @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
61 protected NomenclaturalAuthorTeamSelectionDialog(Shell shell
, ConversationHolder conversation
, String title
,
62 boolean multi
, String settings
, Team agent
) {
63 super(shell
, conversation
, title
, multi
, settings
, agent
);
68 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
69 return new NewTeamWizard(true);
74 protected String
getNewWizardLinkText() {
75 return String
.format("Create a new <a>%1s</a>", "Team ");
80 protected void initModel() {
81 Control control
= getPatternControl();
82 String pattern
= null;
84 pattern
= ((Text
)control
).getText();
87 model
= CdmStore
.getService(IAgentService
.class).getUuidAndAbbrevTitleCache(limitOfInitialElements
, pattern
, Team
.class);
92 protected Team
getPersistentObject(UUID uuid
) {
93 return CdmBase
.deproxy(CdmStore
.getService(IAgentService
.class).load(uuid
), Team
.class) ;