Revision eaa9ba52
Added by Patrick Plitzner about 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TaxonBaseSelectionDialog.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import java.util.UUID; |
14 | 14 |
|
15 |
import org.eclipse.swt.widgets.Composite; |
|
16 |
import org.eclipse.swt.widgets.Control; |
|
17 | 15 |
import org.eclipse.swt.widgets.Shell; |
18 | 16 |
|
19 | 17 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
... | ... | |
22 | 20 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
23 | 21 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
24 | 22 |
import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard; |
23 |
import eu.etaxonomy.taxeditor.newWizard.NewTaxonWizard; |
|
25 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
26 | 25 |
|
27 | 26 |
/** |
... | ... | |
34 | 33 |
|
35 | 34 |
public static TaxonBase selectTaxonBase(Shell shell, ConversationHolder conversation) { |
36 | 35 |
AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(TaxonBase.class, shell, conversation, |
37 |
"Choose a taxon", false, null, null); |
|
36 |
"Choose a taxon/synonym", false, null, null);
|
|
38 | 37 |
return getSelectionFromDialog(dialog); |
39 | 38 |
} |
40 | 39 |
|
... | ... | |
48 | 47 |
|
49 | 48 |
public static Synonym selectSynonym(Shell shell, ConversationHolder conversation) { |
50 | 49 |
AbstractFilteredCdmResourceSelectionDialog<TaxonBase> dialog = new TaxonBaseSelectionDialog(Synonym.class, shell, conversation, |
51 |
"Choose a taxon", false, null, null);
|
|
50 |
"Choose a synonym", false, null, null);
|
|
52 | 51 |
return (Synonym) getSelectionFromDialog(dialog); |
53 | 52 |
} |
54 | 53 |
|
55 | 54 |
private final Class<? extends TaxonBase> clazz; |
56 | 55 |
|
57 | 56 |
protected TaxonBaseSelectionDialog(Class<? extends TaxonBase> clazz, Shell shell, ConversationHolder conversation, String title, boolean multi, TaxonBase taxon, TaxonBase taxonToBeFiltered) { |
58 |
super(shell, conversation, title, multi, ReferenceSelectionDialog.class.getCanonicalName(), taxon);
|
|
57 |
super(shell, conversation, title, multi, TaxonBaseSelectionDialog.class.getCanonicalName(), taxon);
|
|
59 | 58 |
this.cdmBaseToBeFiltered = taxonToBeFiltered; |
60 | 59 |
this.clazz = clazz; |
61 | 60 |
initModel(); |
62 | 61 |
} |
63 | 62 |
|
64 |
/** {@inheritDoc} */ |
|
65 |
@Override |
|
66 |
protected Control createExtendedContentArea(Composite parent) { |
|
67 |
return null; |
|
68 |
} |
|
69 |
|
|
70 | 63 |
/** {@inheritDoc} */ |
71 | 64 |
@Override |
72 | 65 |
protected TaxonBase getPersistentObject(UUID uuid) { |
... | ... | |
90 | 83 |
/** {@inheritDoc} */ |
91 | 84 |
@Override |
92 | 85 |
protected AbstractNewEntityWizard getNewEntityWizard(String parameter) { |
93 |
return null;
|
|
86 |
return new NewTaxonWizard();
|
|
94 | 87 |
} |
95 | 88 |
|
96 | 89 |
/** {@inheritDoc} */ |
97 | 90 |
@Override |
98 | 91 |
protected String getNewWizardLinkText() { |
99 |
return null;
|
|
92 |
return String.format("Create a new <a>%1s</a>", "Taxon ");
|
|
100 | 93 |
} |
101 | 94 |
} |
Also available in: Unified diff
Allow creating new taxa in taxon selection dialog #2402