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
.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
.ICollectionService
;
19 import eu
.etaxonomy
.cdm
.model
.occurrence
.Collection
;
20 import eu
.etaxonomy
.taxeditor
.editor
.newWizard
.AbstractNewEntityWizard
;
21 import eu
.etaxonomy
.taxeditor
.editor
.newWizard
.NewCollectionWizard
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>FilteredCollectionSelectionDialog class.</p>
28 * @created Oct 13, 2010
31 public class CollectionSelectionDialog
extends
32 AbstractFilteredCdmResourceSelectionDialog
<Collection
> {
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 collection a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
40 * @return a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
42 public static Collection
select(Shell shell
, ConversationHolder conversation
, Collection collection
){
43 CollectionSelectionDialog dialog
= new CollectionSelectionDialog(shell
, conversation
,
44 "Choose Collection", false, CollectionSelectionDialog
.class.getCanonicalName(), collection
);
45 return getSelectionFromDialog(dialog
);
49 * <p>Constructor for FilteredCollectionSelectionDialog.</p>
51 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
52 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
53 * @param title a {@link java.lang.String} object.
54 * @param multi a boolean.
55 * @param settings a {@link java.lang.String} object.
56 * @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
58 protected CollectionSelectionDialog(Shell shell
,
59 ConversationHolder conversation
, String title
, boolean multi
,
60 String settings
, Collection cdmObject
) {
61 super(shell
, conversation
, title
, multi
, settings
, cdmObject
);
65 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
69 protected Collection
getPersistentObject(UUID uuid
) {
70 return CdmStore
.getService(ICollectionService
.class).load(uuid
);
74 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
78 protected void initModel() {
79 model
= CdmStore
.getService(ICollectionService
.class).getUuidAndTitleCache();
83 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
87 protected String
getNewWizardLinkText() {
88 return "Click link to create a new <A>Collection</A>.";
92 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
96 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
97 return new NewCollectionWizard();