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.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.model.taxon.TaxonBase;
|
21
|
import eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard;
|
22
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
23
|
|
24
|
/**
|
25
|
* <p>FilteredTaxonBaseSelectionDialog class.</p>
|
26
|
*
|
27
|
* @author n.hoffmann
|
28
|
* @created Sep 21, 2009
|
29
|
* @version 1.0
|
30
|
*/
|
31
|
public class FilteredTaxonBaseSelectionDialog extends
|
32
|
AbstractFilteredCdmResourceSelectionDialog<TaxonBase> {
|
33
|
|
34
|
/**
|
35
|
* <p>select</p>
|
36
|
*
|
37
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
38
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
39
|
* @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
|
40
|
*/
|
41
|
public static TaxonBase select(Shell shell, ConversationHolder conversation) {
|
42
|
FilteredTaxonBaseSelectionDialog dialog = new FilteredTaxonBaseSelectionDialog(shell, conversation,
|
43
|
"Choose a taxon", false, null);
|
44
|
return getSelectionFromDialog(dialog);
|
45
|
}
|
46
|
|
47
|
/**
|
48
|
* <p>Constructor for FilteredTaxonBaseSelectionDialog.</p>
|
49
|
*
|
50
|
* @param shell a {@link org.eclipse.swt.widgets.Shell} object.
|
51
|
* @param title a {@link java.lang.String} object.
|
52
|
* @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
|
53
|
* @param multi a boolean.
|
54
|
* @param taxon a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
|
55
|
*/
|
56
|
protected FilteredTaxonBaseSelectionDialog(Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon) {
|
57
|
super(shell, conversation, title, multi, FilteredReferenceSelectionDialog.class.getCanonicalName(), taxon);
|
58
|
}
|
59
|
|
60
|
/* (non-Javadoc)
|
61
|
* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#createExtendedContentArea(org.eclipse.swt.widgets.Composite)
|
62
|
*/
|
63
|
/** {@inheritDoc} */
|
64
|
@Override
|
65
|
protected Control createExtendedContentArea(Composite parent) {
|
66
|
return null;
|
67
|
}
|
68
|
|
69
|
/* (non-Javadoc)
|
70
|
* @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#getPersistentObject(java.util.UUID)
|
71
|
*/
|
72
|
/** {@inheritDoc} */
|
73
|
@Override
|
74
|
protected TaxonBase getPersistentObject(UUID uuid) {
|
75
|
return CdmStore.getTaxonService().load(uuid);
|
76
|
}
|
77
|
|
78
|
/* (non-Javadoc)
|
79
|
* @see eu.etaxonomy.taxeditor.dialogs.AbstractFilteredCdmResourceSelectionDialog#initModel()
|
80
|
*/
|
81
|
/** {@inheritDoc} */
|
82
|
@Override
|
83
|
protected void initModel() {
|
84
|
model = CdmStore.getTaxonService().getUuidAndTitleCache();
|
85
|
}
|
86
|
|
87
|
/** {@inheritDoc} */
|
88
|
@Override
|
89
|
protected AbstractNewEntityWizard getNewEntityWizard() {
|
90
|
// TODO Auto-generated method stub
|
91
|
return null;
|
92
|
}
|
93
|
|
94
|
/** {@inheritDoc} */
|
95
|
@Override
|
96
|
protected String getNewWizardLinkText() {
|
97
|
// TODO Auto-generated method stub
|
98
|
return null;
|
99
|
}
|
100
|
}
|