Revision 9e550198
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/operation/CreateTermVocabularyOperation.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.runtime.IStatus; |
16 | 16 |
|
17 | 17 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
18 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
19 |
import eu.etaxonomy.cdm.model.common.OrderedTermBase; |
|
20 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
|
21 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
18 | 22 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
19 | 23 |
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput; |
20 | 24 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
... | ... | |
50 | 54 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
51 | 55 |
throws ExecutionException { |
52 | 56 |
|
53 |
TermVocabulary termVocabulary = |
|
54 |
TermVocabulary.NewInstance(definedEditorInput.getTermType(), |
|
55 |
null, |
|
56 |
"Untitled", |
|
57 |
null, |
|
58 |
null); |
|
57 |
TermType type= definedEditorInput.getTermType(); |
|
58 |
DefinedTermBase test = type.getEmptyDefinedTermBase(); |
|
59 |
TermVocabulary termVocabulary = null; |
|
60 |
if (test instanceof OrderedTermBase){ |
|
61 |
termVocabulary = OrderedTermVocabulary.NewInstance(definedEditorInput.getTermType(), |
|
62 |
null, |
|
63 |
"Untitled", |
|
64 |
null, |
|
65 |
null); |
|
66 |
} |
|
67 |
|
|
68 |
if (termVocabulary == null){ |
|
69 |
termVocabulary = |
|
70 |
TermVocabulary.NewInstance(definedEditorInput.getTermType(), |
|
71 |
null, |
|
72 |
"Untitled", |
|
73 |
null, |
|
74 |
null); |
|
75 |
} |
|
59 | 76 |
|
60 | 77 |
termVocabulary = CdmStore.getService(IVocabularyService.class).save(termVocabulary); |
61 | 78 |
definedEditorInput.getVocabularies().add(termVocabulary); |
Also available in: Unified diff
fix #4821: create OrderedTermvoc for OrderedTerms