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