e2c05bb616ac11e16c28926ffe6217df646f2a11
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialogs / filteredSelection / ClassificationSelectionDialog.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection;
12
13 import java.util.UUID;
14
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.swt.widgets.Shell;
18
19 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
20 import eu.etaxonomy.cdm.api.service.IClassificationService;
21 import eu.etaxonomy.cdm.model.taxon.Classification;
22 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
23 import eu.etaxonomy.taxeditor.store.CdmStore;
24
25 /**
26 * <p>FilteredClassificationSelectionDialog class.</p>
27 *
28 * @author n.hoffmann
29 * @created Sep 21, 2009
30 * @version 1.0
31 */
32 public class ClassificationSelectionDialog extends
33 AbstractFilteredCdmResourceSelectionDialog<Classification> {
34
35 /**
36 * <p>select</p>
37 *
38 * @param shell a {@link org.eclipse.swt.widgets.Shell} object.
39 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
40 * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
41 */
42 public static Classification select(Shell shell, ConversationHolder conversation) {
43 ClassificationSelectionDialog dialog = new ClassificationSelectionDialog(shell, conversation,
44 "Choose a Classification", false, "", null);
45 return getSelectionFromDialog(dialog);
46 }
47
48 /**
49 * <p>Constructor for FilteredClassificationSelectionDialog.</p>
50 *
51 * @param shell a {@link org.eclipse.swt.widgets.Shell} 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 conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
56 * @param classification a {@link eu.etaxonomy.cdm.model.taxon.TaxonomicTree} object.
57 */
58 protected ClassificationSelectionDialog(Shell shell, ConversationHolder conversation, String title,
59 boolean multi, String settings, Classification classification) {
60 super(shell, conversation, title, multi, settings, classification);
61 }
62
63 /* (non-Javadoc)
64 * @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
65 */
66 /** {@inheritDoc} */
67 @Override
68 protected Control createExtendedContentArea(Composite parent) {
69 return null;
70 }
71
72 /* (non-Javadoc)
73 * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
74 */
75 /** {@inheritDoc} */
76 @Override
77 protected Classification getPersistentObject(UUID cdmUuid) {
78 return CdmStore.getService(IClassificationService.class).getClassificationByUuid(cdmUuid);
79 }
80
81 /* (non-Javadoc)
82 * @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()
83 */
84 /** {@inheritDoc} */
85 @Override
86 protected void initModel() {
87 model = CdmStore.getService(IClassificationService.class).getUuidAndTitleCache();
88 }
89
90 /** {@inheritDoc} */
91 @Override
92 protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
93 return null;
94 }
95
96 /** {@inheritDoc} */
97 @Override
98 protected String getNewWizardLinkText() {
99 return null;
100 }
101 }