bugfix for position = -1
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 8 Aug 2012 23:23:32 +0000 (23:23 +0000)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 8 Aug 2012 23:23:32 +0000 (23:23 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/EditFeatureTreeWizardPage.java

index 6f4b12b14b7030a7ee3ba101bd9896c66b1c0ffe..d0216c84a389b76b3725113bb6f725cb0d3ebf18 100644 (file)
@@ -287,7 +287,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                                int location = getCurrentLocation();
                                FeatureNode parent = target.getParent();
                                if (location == LOCATION_BEFORE) {
-                                       position = parent.getIndex(target) - 1;
+                                       position = Math.max(0, parent.getIndex(target) - 1);
                                        target = parent;
                                }
 
@@ -309,8 +309,7 @@ public class EditFeatureTreeWizardPage extends WizardPage implements
                        // cannot drop a feature node onto itself
                        for (Object droppedObject : droppedObjects) {
                                if (droppedObject == null) {
-                                       StoreUtil
-                                                       .warningDialog(
+                                       StoreUtil.warningDialog(
                                                                        "Operation not supported yet",
                                                                        this,
                                                                        "We are currently unable to change the order of freshly created "