ref #8115: drag&drop is not allowed for not persisted elements in source and target...
authorKatja Luther <k.luther@bgbm.org>
Wed, 3 Apr 2019 11:55:38 +0000 (13:55 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 3 Apr 2019 11:55:38 +0000 (13:55 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptionElementDropAdapter.java

index 71adb3bc53658ceb85d6aaf80bd70b62924133ad..20f5f876f5e5c7c6326721ca074024198b1f3005 100644 (file)
@@ -85,6 +85,15 @@ public class DescriptionElementDropAdapter extends EditViewerDropAdapter {
 
                                            }
                                        }
+                                       for (Object element : descriptionElement.getInDescription().getElements()){
+                        if (element instanceof DescriptionElementBase){
+                           if( !((DescriptionElementBase)element).isPersited()){
+                               MessagingUtils.warningDialog(OPERATION_NOT_SUPPORTED_YET, this, Messages.DescriptionElementDropAdapter_NOT_SUPPORTED_NEW_ELEMENT_IN_DESCRIPTION);
+                                return false;
+                           }
+
+                        }
+                    }
                                        description = descriptionElement.getInDescription();
                                        description.removeElement(descriptionElement);
                                        target.addElement(descriptionElement);