Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 387678
Collapse All | Expand All

(-)a/bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/dndaddon/StackDropAgent.java (-1 / +7 lines)
Lines 223-229 Link Here
223
223
224
		// 'dropIndex' is now the index of the CTabItem to put ourselves before
224
		// 'dropIndex' is now the index of the CTabItem to put ourselves before
225
		// we need to adjust this to be a model index
225
		// we need to adjust this to be a model index
226
		if (dropIndex < dropCTF.getItemCount()) {
226
		int ctfItemCount = dropCTF.getItemCount();
227
		if (dropIndex < ctfItemCount) {
227
			CTabItem item = dropCTF.getItem(dropIndex);
228
			CTabItem item = dropCTF.getItem(dropIndex);
228
			MUIElement itemModel = (MUIElement) item.getData(AbstractPartRenderer.OWNING_ME);
229
			MUIElement itemModel = (MUIElement) item.getData(AbstractPartRenderer.OWNING_ME);
229
230
Lines 232-237 Link Here
232
				return;
233
				return;
233
234
234
			dropIndex = itemModel.getParent().getChildren().indexOf(itemModel);
235
			dropIndex = itemModel.getParent().getChildren().indexOf(itemModel);
236
			// if the item is dropped at the last position, there is
237
			// no existing item to put ourselves before
238
			// so we'll just go to the end.
239
		} else if (dropIndex == ctfItemCount) {
240
			dropIndex = dropStack.getChildren().size();
235
		}
241
		}
236
242
237
		if (dragElement instanceof MStackElement) {
243
		if (dragElement instanceof MStackElement) {

Return to bug 387678