ref #6694 Fix drag and drop behavior
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 20 Jun 2017 16:31:09 +0000 (18:31 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 20 Jun 2017 16:31:09 +0000 (18:31 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/FeatureTreeContentProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureNodeDropAdapter.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java

index f2b24eed3d57b8abba3c2f239435c1c5aa8e3e1f..64690fc347d526025a64bbef6ddfbf7632d59e7b 100644 (file)
@@ -72,6 +72,9 @@ public class FeatureTreeContentProvider implements ITreeContentProvider {
        /** {@inheritDoc} */
        @Override
        public Object getParent(Object element) {
+           if(element instanceof FeatureNode){
+               return ((FeatureNode) element).getParent();
+           }
                return null;
        }
 
index 7d8607040faf21119dcf19fd3f38d42ebc59c16f..a9832364dc0dc7a38271a4cf44809e929496b0f0 100644 (file)
@@ -66,7 +66,7 @@ class FeatureNodeDropAdapter extends ViewerDropAdapter {
                        FeatureNode droppedNode = (FeatureNode) droppedObject;
                        CdmStore.getService(IFeatureNodeService.class).moveFeatureNode(droppedNode.getUuid(), target.getUuid(), position);
                        viewer.refresh();
-//                     viewer.reveal(droppedNode);
+                       viewer.reveal(droppedNode);
                }
         this.featureTreeEditor.setDirty(true);
                return true;
index d74a394fddbefe2cbef2233b9f4fd5e6ce420763..c5cb418675b64c21237d003107bd263c6ab58dc5 100644 (file)
@@ -167,6 +167,7 @@ public class FeatureTreeEditor implements
                                }
                                setDirty(true);
                                composite.getViewer().refresh();
+                               composite.getViewer().expandToLevel(parent, 1);
                        }
                }