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
.Institution
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.NewInstitutionWizard
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * @created Dec 15, 2010
28 public class InstitutionSelectionDialog
extends
29 AbstractFilteredCdmResourceSelectionDialog
<Institution
> {
31 public static Institution
select(Shell shell
,// ConversationHolder conversation,
32 Institution institution
){
33 InstitutionSelectionDialog dialog
= new InstitutionSelectionDialog(shell
, //conversation,
34 "Choose Institution", false, TeamSelectionDialog
.class.getCanonicalName(), institution
);
35 return getSelectionFromDialog(dialog
);
46 protected InstitutionSelectionDialog(Shell shell
,//ConversationHolder conversation,
47 String title
, boolean multi
,
48 String settings
, Institution cdmObject
) {
49 super(shell
, //conversation,
50 title
, multi
, settings
, cdmObject
);
54 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
57 protected Institution
getPersistentObject(UUID uuid
) {
58 AgentBase agentBase
= CdmStore
.getService(IAgentService
.class).load(uuid
);
60 if(agentBase
instanceof Institution
){
61 return (Institution
) agentBase
;
67 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
70 protected void callService(String pattern
) {
72 model
= CdmStore
.getService(IAgentService
.class).getUuidAndTitleCache(Institution
.class, limitOfInitialElements
,pattern
);
78 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
81 protected String
[] getNewWizardText() {
82 return new String
[]{"New Institution"};
86 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String)
89 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
90 return new NewInstitutionWizard();