ref #6694 Always add new features to root node
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 21 Jun 2017 07:58:06 +0000 (09:58 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 21 Jun 2017 08:00:11 +0000 (10:00 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java

index 16399d9dbd8ad034251afbdeeda567975dcfac1d..adcee70c07420756c7dc64e640aba06c882962c4 100644 (file)
@@ -215,9 +215,7 @@ public class FeatureTreeEditor implements ICdmEntitySessionEnabled,
                        WizardDialog dialog = new WizardDialog(shell, wizard);
 
                        if (dialog.open() == IStatus.OK) {
-                IStructuredSelection selection = (IStructuredSelection) composite.getViewer().getSelection();
-                FeatureNode parent = (FeatureNode) (selection.getFirstElement() != null ? selection.getFirstElement()
-                        : ((FeatureTree) composite.getViewer().getInput()).getRoot());
+                FeatureNode parent = ((FeatureTree) composite.getViewer().getInput()).getRoot();
                 Collection<Feature> additionalFeatures = wizard.getAdditionalFeatures();
                 for (Feature feature : additionalFeatures) {
                                    CdmStore.getService(IFeatureNodeService.class).addChildFeaturNode(parent, feature);