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 search() {
71 model
= CdmStore
.getService(IAgentService
.class).getInstitutionUuidAndTitleCache();
75 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
78 protected String
[] getNewWizardText() {
79 return new String
[]{"Institution "};
83 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String)
86 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
87 return new NewInstitutionWizard();