Project

General

Profile

« Previous | Next » 

Revision 02a1a17e

Added by pplitzner over 4 years ago

ref #8238 Allow adding subtypes to term trees

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDropAdapter.java
113 113
		    TermType droppedType = null;
114 114
		    if(droppedObject instanceof IHasTermType){
115 115
		        droppedType = ((IHasTermType)droppedObject).getTermType();
116
		        if(droppedType!=null && !droppedType.equals(targetType)){
116
		        if(droppedType!=null && !droppedType.equals(targetType) && !droppedType.isKindOf(targetType)){
117 117
		            MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
118 118
		            continue;
119 119
		        }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/operation/MoveFeatureOperation.java
15 15
import org.eclipse.core.runtime.Status;
16 16
import org.eclipse.swt.dnd.DND;
17 17

  
18
import eu.etaxonomy.cdm.api.service.IFeatureNodeService;
18
import eu.etaxonomy.cdm.api.service.ITermNodeService;
19 19
import eu.etaxonomy.cdm.api.service.UpdateResult;
20 20
import eu.etaxonomy.cdm.model.term.TermNode;
21 21
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
......
53 53
        UpdateResult updateResult = null;
54 54
        //move operation
55 55
        if(currentOperation==DND.DROP_MOVE){
56
            updateResult = CdmStore.getService(IFeatureNodeService.class).moveFeatureNode(droppedNode.getUuid(), target.getUuid(), position);
56
            updateResult = CdmStore.getService(ITermNodeService.class).moveNode(droppedNode.getUuid(), target.getUuid(), position);
57 57
        }
58 58
        //copy operation
59 59
        else if(currentOperation==DND.DROP_COPY){
60
            updateResult = CdmStore.getService(IFeatureNodeService.class).addChildFeatureNode(target.getUuid(), droppedNode.getTerm().getUuid());
60
            updateResult = CdmStore.getService(ITermNodeService.class).addChildNode(target.getUuid(), droppedNode.getTerm().getUuid());
61 61
        }
62 62
        if(updateResult!=null){
63 63
            return postExecute(updateResult.getCdmEntity());

Also available in: Unified diff