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
.model
.occurrence
.Collection
;
19 import eu
.etaxonomy
.taxeditor
.editor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.editor
.newWizard
.NewCollectionWizard
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
24 * <p>FilteredCollectionSelectionDialog class.</p>
27 * @created Oct 13, 2010
30 public class FilteredCollectionSelectionDialog
extends
31 AbstractFilteredCdmResourceSelectionDialog
<Collection
> {
36 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param collection a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
39 * @return a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
41 public static Collection
select(Shell shell
, ConversationHolder conversation
, Collection collection
){
42 FilteredCollectionSelectionDialog dialog
= new FilteredCollectionSelectionDialog(shell
, conversation
,
43 "Choose Collection", false, FilteredCollectionSelectionDialog
.class.getCanonicalName(), collection
);
44 return getSelectionFromDialog(dialog
);
48 * <p>Constructor for FilteredCollectionSelectionDialog.</p>
50 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
51 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
52 * @param title a {@link java.lang.String} object.
53 * @param multi a boolean.
54 * @param settings a {@link java.lang.String} object.
55 * @param cdmObject a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
57 protected FilteredCollectionSelectionDialog(Shell shell
,
58 ConversationHolder conversation
, String title
, boolean multi
,
59 String settings
, Collection cdmObject
) {
60 super(shell
, conversation
, title
, multi
, settings
, cdmObject
);
64 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
68 protected Collection
getPersistentObject(UUID uuid
) {
69 return CdmStore
.getCollectionService().load(uuid
);
73 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#initModel()
77 protected void initModel() {
78 model
= CdmStore
.getCollectionService().getUuidAndTitleCache();
82 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
86 protected String
getNewWizardLinkText() {
87 return "Click link to create a new <A>Collection</A>.";
91 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
95 protected AbstractNewEntityWizard
getNewEntityWizard() {
96 return new NewCollectionWizard();