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
.AgentBase
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
18 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.NewInstitutionWizard
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
24 * @created Dec 15, 2010
26 public class InstitutionSelectionDialog
extends
27 AbstractFilteredCdmResourceSelectionDialog
<Institution
> {
29 public static Institution
select(Shell shell
,
30 Institution institution
){
31 InstitutionSelectionDialog dialog
= new InstitutionSelectionDialog(shell
, //conversation,
32 "Choose Institution", false, TeamSelectionDialog
.class.getCanonicalName(), institution
);
33 return getSelectionFromDialog(dialog
);
36 protected InstitutionSelectionDialog(Shell shell
,
37 String title
, boolean multi
,
38 String settings
, Institution cdmObject
) {
39 super(shell
, title
, multi
, settings
, cdmObject
);
43 protected Institution
getPersistentObject(UUID uuid
) {
44 AgentBase
<?
> agentBase
= CdmStore
.getService(IAgentService
.class).load(uuid
);
46 if(agentBase
instanceof Institution
){
47 return (Institution
) agentBase
;
53 protected void callService(String pattern
) {
54 model
= CdmStore
.getService(IAgentService
.class)
55 .getUuidAndTitleCache(Institution
.class, limitOfInitialElements
, pattern
);
59 protected String
[] getNewWizardText() {
60 return new String
[]{"New Institution"};
64 protected AbstractNewEntityWizard
<Institution
> getNewEntityWizard(String parameter
) {
65 return new NewInstitutionWizard();