ref #8146 Adjust term type check
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 2 Apr 2019 13:49:32 +0000 (15:49 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 2 Apr 2019 13:49:32 +0000 (15:49 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeDropAdapter.java

index ddba0518caecb817429b64fd630f99fd7fd531e5..3c4257ce821f316ec3c6a399e47909cd8ff976eb 100644 (file)
@@ -113,13 +113,17 @@ public class FeatureTreeDropAdapter extends ViewerDropAdapter {
                    TermType droppedType = null;
                    if(droppedObject instanceof IHasTermType){
                        droppedType = ((IHasTermType)droppedObject).getTermType();
+                       if(droppedType!=null && !droppedType.equals(targetType)){
+                           MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
+                           continue;
+                       }
                    }
                    else if(droppedObject instanceof TermDto){
                        droppedType = ((TermDto)droppedObject).getTermType();
-                   }
-                   if(droppedType!=null && !droppedType.equals(targetType)){
-                       MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
-                       continue;
+                       if(droppedType!=null && !droppedType.equals(targetType) && !droppedType.isKindOf(targetType)){
+                    MessagingUtils.warningDialog(DefinedTermDropAdapterE4.TERM_TYPE_ERROR_TITLE, this, DefinedTermDropAdapterE4.TERM_TYPE_ERROR_MESSAGE);
+                    continue;
+                }
                    }
                    if(droppedObject instanceof FeatureNode){
                        FeatureNode droppedNode = (FeatureNode) droppedObject;