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
.AgentBase
;
18 import eu
.etaxonomy
.cdm
.model
.agent
.Team
;
19 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.NewTeamWizard
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>FilteredNomenclaturalAuthorTeamSelectionDialog class.</p>
28 * @created Jun 22, 2010
31 public class NomenclaturalAuthorTeamSelectionDialog
extends
32 AbstractFilteredCdmResourceSelectionDialog
<AgentBase
> {
37 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
38 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
39 * @param team a {@link eu.etaxonomy.cdm.model.agent.Team} object.
40 * @return a {@link eu.etaxonomy.cdm.model.agent.Team} object.
42 public static Team
select(Shell shell
, //ConversationHolder conversation,
44 NomenclaturalAuthorTeamSelectionDialog dialog
= new NomenclaturalAuthorTeamSelectionDialog(shell
, //conversation,
45 "Choose Author Team", false, NomenclaturalAuthorTeamSelectionDialog
.class.getCanonicalName(), team
);
46 return (Team
)getSelectionFromDialog(dialog
);
50 * <p>Constructor for FilteredNomenclaturalAuthorTeamSelectionDialog.</p>
52 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
53 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
54 * @param title a {@link java.lang.String} object.
55 * @param multi a boolean.
56 * @param settings a {@link java.lang.String} object.
57 * @param agent a {@link eu.etaxonomy.cdm.model.agent.Team} object.
59 protected NomenclaturalAuthorTeamSelectionDialog(Shell shell
, //ConversationHolder conversation,
61 boolean multi
, String settings
, Team agent
) {
62 super(shell
, //conversation,
63 title
, multi
, settings
, agent
);
68 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
69 return new NewTeamWizard(true);
74 protected String
[] getNewWizardText() {
75 return new String
[]{"new Team"};
78 // /** {@inheritDoc} */
80 // protected void search() {
81 // Control control =getSearchField();
82 // String pattern = null;
83 // if (control != 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) ;
97 * @see eu.etaxonomy.taxeditor.ui.dialog.selection.AbstractFilteredCdmResourceSelectionDialog#callService(java.lang.String)
100 void callService(String pattern
) {
101 model
= CdmStore
.getService(IAgentService
.class).getUuidAndAbbrevTitleCache(limitOfInitialElements
, pattern
, Team
.class);