ref #6694 Always add new features to root node
[taxeditor.git] / 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);