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
.dialogs
.filteredSelection
;
13 import java
.util
.UUID
;
15 import org
.eclipse
.swt
.widgets
.Shell
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.api
.service
.IAgentService
;
19 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
20 import eu
.etaxonomy
.cdm
.model
.agent
.Institution
;
21 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
22 import eu
.etaxonomy
.taxeditor
.newWizard
.NewInstitutionWizard
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * @created Dec 15, 2010
30 public class InstitutionSelectionDialog
extends
31 AbstractFilteredCdmResourceSelectionDialog
<Institution
> {
33 public static Institution
select(Shell shell
, ConversationHolder conversation
, Institution institution
){
34 InstitutionSelectionDialog dialog
= new InstitutionSelectionDialog(shell
, conversation
,
35 "Choose Institution", false, TeamSelectionDialog
.class.getCanonicalName(), institution
);
36 return getSelectionFromDialog(dialog
);
47 protected InstitutionSelectionDialog(Shell shell
,
48 ConversationHolder conversation
, String title
, boolean multi
,
49 String settings
, Institution cdmObject
) {
50 super(shell
, conversation
, 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#initModel()
70 protected void initModel() {
71 model
= CdmStore
.getService(IAgentService
.class).getInstitutionUuidAndTitleCache();
75 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
78 protected String
getNewWizardLinkText() {
79 return "Create a new <A>Institution</A>.";
83 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard(java.lang.String)
86 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
87 return new NewInstitutionWizard();