diff options
| author | Piotr Aniola | 2013-01-10 20:46:12 +0000 |
|---|---|---|
| committer | Eric Moffatt | 2013-01-10 20:46:12 +0000 |
| commit | a0c375018d74ecb34887eafb9cc7195863e39dbf (patch) | |
| tree | 126191211ac004d5226e177094f91507e8eff8f2 | |
| parent | 923c49b5ab2b7e78504051413500bd8ac83393d9 (diff) | |
| download | eclipse.platform.ui-a0c375018d74ecb34887eafb9cc7195863e39dbf.tar.gz eclipse.platform.ui-a0c375018d74ecb34887eafb9cc7195863e39dbf.tar.xz eclipse.platform.ui-a0c375018d74ecb34887eafb9cc7195863e39dbf.zip | |
Bug 387678 - [DND] Drag and Drop of view tabs behaves unpredictablyv20130110-204612
(drop feedback and drop behavior)
| -rw-r--r-- | bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java index 12e99b59318..9f756c4976f 100644 --- a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java +++ b/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java @@ -223,7 +223,8 @@ public class StackDropAgent extends DropAgent { // 'dropIndex' is now the index of the CTabItem to put ourselves before // we need to adjust this to be a model index - if (dropIndex < dropCTF.getItemCount()) { + int ctfItemCount = dropCTF.getItemCount(); + if (dropIndex < ctfItemCount) { CTabItem item = dropCTF.getItem(dropIndex); MUIElement itemModel = (MUIElement) item.getData(AbstractPartRenderer.OWNING_ME); @@ -232,6 +233,11 @@ public class StackDropAgent extends DropAgent { return; dropIndex = itemModel.getParent().getChildren().indexOf(itemModel); + // if the item is dropped at the last position, there is + // no existing item to put ourselves before + // so we'll just go to the end. + } else if (dropIndex == ctfItemCount) { + dropIndex = dropStack.getChildren().size(); } if (dragElement instanceof MStackElement) { |
