Project

General

Profile

Download (3.42 KB) Statistics
| Branch: | Tag: | Revision:
1 74b9f670 n.hoffmann
/**
2
* Copyright (C) 2007 EDIT
3 496d0049 Patric Plitzner
* European Distributed Institute of Taxonomy
4 74b9f670 n.hoffmann
* http://www.e-taxonomy.eu
5 496d0049 Patric Plitzner
*
6 74b9f670 n.hoffmann
* 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.
8
*/
9
10 78222507 n.hoffmann
package eu.etaxonomy.taxeditor.ui.dialog.selection;
11 74b9f670 n.hoffmann
12
import java.util.UUID;
13
14
import org.eclipse.swt.widgets.Shell;
15
16 db5e366d n.hoffmann
import eu.etaxonomy.cdm.api.service.ICollectionService;
17 74b9f670 n.hoffmann
import eu.etaxonomy.cdm.model.occurrence.Collection;
18 f211dd28 n.hoffmann
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
19
import eu.etaxonomy.taxeditor.newWizard.NewCollectionWizard;
20 74b9f670 n.hoffmann
import eu.etaxonomy.taxeditor.store.CdmStore;
21
22
/**
23 3be6ef3e n.hoffmann
 * <p>FilteredCollectionSelectionDialog class.</p>
24
 *
25 74b9f670 n.hoffmann
 * @author n.hoffmann
26
 * @created Oct 13, 2010
27
 * @version 1.0
28
 */
29 9a0f58cd n.hoffmann
public class CollectionSelectionDialog extends
30 74b9f670 n.hoffmann
		AbstractFilteredCdmResourceSelectionDialog<Collection> {
31 496d0049 Patric Plitzner
32 3be6ef3e n.hoffmann
	/**
33
	 * <p>select</p>
34
	 *
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.
39
	 */
40 f5979052 Katja Luther
	public static Collection select(Shell shell, //ConversationHolder conversation,
41
	        Collection collection){
42
		CollectionSelectionDialog dialog = new CollectionSelectionDialog(shell, //conversation,
43 9a0f58cd n.hoffmann
				"Choose Collection", false, CollectionSelectionDialog.class.getCanonicalName(), collection);
44 74b9f670 n.hoffmann
		return getSelectionFromDialog(dialog);
45
	}
46 496d0049 Patric Plitzner
47 74b9f670 n.hoffmann
	/**
48 3be6ef3e n.hoffmann
	 * <p>Constructor for FilteredCollectionSelectionDialog.</p>
49
	 *
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.
56 74b9f670 n.hoffmann
	 */
57 f5979052 Katja Luther
	protected CollectionSelectionDialog(Shell shell,//ConversationHolder conversation,
58
			 String title, boolean multi,
59 74b9f670 n.hoffmann
			String settings, Collection cdmObject) {
60 f5979052 Katja Luther
		super(shell, //conversation,
61
		        title, multi, settings, cdmObject);
62 74b9f670 n.hoffmann
	}
63
64
	/* (non-Javadoc)
65
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
66
	 */
67 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
68 74b9f670 n.hoffmann
	@Override
69
	protected Collection getPersistentObject(UUID uuid) {
70 db5e366d n.hoffmann
		return CdmStore.getService(ICollectionService.class).load(uuid);
71 74b9f670 n.hoffmann
	}
72
73
	/* (non-Javadoc)
74 d41c6a72 Katja Luther
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#search
75 74b9f670 n.hoffmann
	 */
76 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
77 74b9f670 n.hoffmann
	@Override
78 0ce80af9 Katja Luther
	protected void callService(String pattern) {
79
	   model = CdmStore.getService(ICollectionService.class).getUuidAndTitleCache(limitOfInitialElements,pattern);
80
    }
81 74b9f670 n.hoffmann
82
	/* (non-Javadoc)
83
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewWizardLinkText()
84
	 */
85 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
86 74b9f670 n.hoffmann
	@Override
87 5aeccadc Katja Luther
	protected String[] getNewWizardText() {
88 6e43b539 Katja Luther
        return new String[]{ "New Collection"};
89 74b9f670 n.hoffmann
	}
90
91
	/* (non-Javadoc)
92
	 * @see eu.etaxonomy.taxeditor.dialogs.filteredSelection.AbstractFilteredCdmResourceSelectionDialog#getNewEntityWizard()
93
	 */
94 3be6ef3e n.hoffmann
	/** {@inheritDoc} */
95 74b9f670 n.hoffmann
	@Override
96 9a0f58cd n.hoffmann
	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
97 74b9f670 n.hoffmann
		return new NewCollectionWizard();
98
	}
99
100 496d0049 Patric Plitzner
101 74b9f670 n.hoffmann
}