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
.ICollectionService
;
17 import eu
.etaxonomy
.cdm
.model
.occurrence
.Collection
;
18 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.NewCollectionWizard
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 * <p>FilteredCollectionSelectionDialog class.</p>
26 * @created Oct 13, 2010
29 public class CollectionSelectionDialog
extends
30 AbstractFilteredCdmResourceSelectionDialog
<Collection
> {
35 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param collection a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
38 * @return a {@link eu.etaxonomy.cdm.model.occurrence.Collection} object.
40 public static Collection
select(Shell shell
, //ConversationHolder conversation,
41 Collection collection
){
42 CollectionSelectionDialog dialog
= new CollectionSelectionDialog(shell
, //conversation,
43 "Choose Collection", false, CollectionSelectionDialog
.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 CollectionSelectionDialog(Shell shell
,//ConversationHolder conversation,
58 String title
, boolean multi
,
59 String settings
, Collection cdmObject
) {
60 super(shell
, //conversation,
61 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#search
78 protected void callService(String pattern
) {
79 model
= CdmStore
.getService(ICollectionService
.class).getUuidAndTitleCache(limitOfInitialElements
,pattern
);
83 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
87 protected String
[] getNewWizardText() {
88 return new String
[]{ "New Collection"};
92 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
96 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
97 return new NewCollectionWizard();