Revision 35b01984
Added by Patrick Plitzner about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDropAdapter.java | ||
---|---|---|
20 | 20 |
import org.eclipse.jface.viewers.ViewerDropAdapter; |
21 | 21 |
import org.eclipse.swt.dnd.TransferData; |
22 | 22 |
|
23 |
import eu.etaxonomy.cdm.api.service.ITermService; |
|
24 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
|
25 | 23 |
import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary; |
24 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
26 | 25 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
27 | 26 |
import eu.etaxonomy.cdm.model.description.Feature; |
28 | 27 |
import eu.etaxonomy.cdm.model.description.FeatureNode; |
... | ... | |
37 | 36 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
38 | 37 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
39 | 38 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
40 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
41 | 39 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
42 | 40 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.TermVocabularySelectionDialog; |
43 | 41 |
import eu.etaxonomy.taxeditor.view.webimport.termimport.wrapper.OntologyTermWrapper; |
... | ... | |
121 | 119 |
else if(droppedObject instanceof Feature){ |
122 | 120 |
Feature droppedFeature = (Feature) droppedObject; |
123 | 121 |
AddFeatureOperation operation = new AddFeatureOperation( |
124 |
(Feature) CdmStore.getService(ITermService.class).load(droppedFeature.getUuid()),
|
|
122 |
droppedFeature.getUuid(),
|
|
125 | 123 |
target, position, editor, editor); |
126 | 124 |
AbstractUtility.executeOperation(operation, sync); |
127 | 125 |
} |
128 | 126 |
else if(droppedObject instanceof TermDto){ |
129 | 127 |
TermDto termDto = (TermDto) droppedObject; |
130 |
DefinedTermBase term = CdmStore.getService(ITermService.class).load(termDto.getUuid()); |
|
131 |
if(term.isInstanceOf(Feature.class)){ |
|
128 |
if(termDto.getTermType().equals(TermType.Feature)){ |
|
132 | 129 |
AddFeatureOperation operation = new AddFeatureOperation( |
133 |
(Feature)term,
|
|
130 |
termDto.getUuid(),
|
|
134 | 131 |
target, position, editor, editor); |
135 | 132 |
AbstractUtility.executeOperation(operation, sync); |
136 | 133 |
} |
Also available in: Unified diff
ref #8011 Refactor AddFeatureOperation to use uuid